Socket
Book a DemoInstallSign in
Socket

@msquared/web3-metagame-sdk

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@msquared/web3-metagame-sdk

A TypeScript SDK for game-focused web 3 tooling

0.0.52
latest
npmnpm
Version published
Maintainers
3
Created
Source

Msquared Web3 Metagame SDK

A typescript SDK that abstracts the complexity of using web3 tooling for gaming within a browser or server environment

Key features

  • User data backed by an on-chain key value store

Usage

Installation

NPM

npm i @msquared/web3-metagame-sdk

Yarn

yarn add @msquared/web3-metagame-sdk

Peer Dependencies

In order to use this SDK, a viem public (and optionally wallet client) is required

The goal with this SDK is to detach any keys / signers from on-chain interactions!

Example - Registering and emitting an event schema without building a contract

import { SDK } from "@msquared/web3-metagame-sdk"

// Instantiate the SDK
const sdk = new SDK({
    public: getPublicClient(),
    wallet: getWalletClient(), // Required to execute transactions
})

// Update register the event
let hash = await sdk.events.registerEventSchema(name, id, eventTopic, args)

await waitForTransactionReceipt({ hash })

// Emit the event referencing name and passing data
hash = await sdk.events.emitEvent(name, topics, data)

await waitForTransactionReceipt({ hash })

// Read data from indexer

Example - Reading Data from chain

import { SDK } from "@msquared/web3-metagame-sdk"

// Instantiate the SDK with just a public viem client
const sdk = new SDK({ public: getPublicClient() })

// Fetch the profile
const profile = await sdk.player.data.getProfile(
    getAddress(wallet),
)

Example - Writing Data on-chain

import { SDK } from "@msquared/web3-metagame-sdk"

// Instantiate the SDK
const sdk = new SDK({
    public: getPublicClient(),
    wallet: getWalletClient(), // Required to execute transactions
})

// Update the profile onchain
const hash = await sdk.player.data.setProfile(profile, account)

Keywords

typescript

FAQs

Package last updated on 01 Sep 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.