JavaScript/TypeScript SDK for interacting with Sovereign SDK rollups. This monorepo contains packages that provide type-safe transaction submission, signing capabilities, and rollup type serialization/deserialization.
Package | Version | Description |
---|---|---|
@sovereign-sdk/web3 | Primary client library for interacting with Sovereign SDK rollups | |
@sovereign-sdk/signers | Signer interface and implementations (e.g. MetaMask Snap) | |
@sovereign-sdk/universal-wallet-wasm | WebAssembly bindings for human readable byte representation and serialization/deserialization | |
@sovereign-sdk/modules | Convenient helpers for interacting with core Sovereign SDK modules | |
@sovereign-sdk/test | Testing utilities for Sovereign SDK rollups, including soak testing and transaction generation | |
@sovereign-sdk/utils | Common utilities and helper functions for Sovereign SDK development |
- 🔄 Type-safe transaction submission and signing
- 🔍 Runtime call simulation for gas estimation
- 📦 Borsh serialization & human readable byte representation
- 🎯 Strongly typed rollup interactions
- 🌐 Full access to ledger, sequencer, and rollup APIs
A quick example of submitting a transaction to a Sovereign SDK rollup using Sovereign's universal MetaMask Snap as the wallet/signer.
# Install the main web3 package
npm install @sovereign-sdk/web3
# For MetaMask Snap support
npm install @sovereign-sdk/signers
Usage:
import { StandardRollup } from "@sovereign-sdk/web3";
import { Secp256k1Signer } from "@sovereign-sdk/signers";
// Initialize the rollup client
const rollup = new StandardRollup({
url: "https://your-rollup-node.com",
});
// If your rollup is using ethereum style addresses/keypairs
const signer = new Secp256k1Signer(process.env.PRIVATE_KEY);
// Submit a transaction
// Sends a `ValueSetter` call message of `SetValue` type.
// This particular call message has `value` and `gas` fields.
const result = await rollup.call(
{
value_setter: {
set_value: {
value: 100,
gas: null,
},
},
},
{ signer }
);
This project uses pnpm for package management and Changesets for versioning.
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Format and lint
pnpm run fix
For detailed development instructions, see DEVELOPMENT.md.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For security concerns, please open an issue or contact us directly. We take security issues seriously and will respond promptly.