SDK Overview
@snapshot-labs/sx is the official TypeScript SDK for interacting with Snapshot X governance infrastructure. It provides a unified interface for creating and managing governance actions across multiple blockchain networks and offchain environments.
What is @snapshot-labs/sx?
The SDK is a comprehensive toolkit that enables developers to:- Create and manage governance spaces
- Submit and vote on proposals
- Execute approved proposals onchain
- Implement custom voting strategies
- Support multiple blockchain networks (Ethereum, Starknet, Polygon, Arbitrum, Optimism, Base, Mantle, and more)
- Work with offchain Snapshot spaces
- Handle cross-chain governance scenarios
Key Features
Multi-Network Support
The SDK supports three execution environments:- EVM Networks: Ethereum mainnet, Sepolia, Optimism, Polygon, Arbitrum, Base, Mantle, and ApeChain
- Starknet: Native Starknet transactions and cross-chain messaging
- Offchain: Traditional Snapshot spaces with gasless voting
Flexible Client Architecture
The SDK provides specialized clients for different signing and transaction patterns:- Signature-based clients (
EthereumSig,StarknetSig) for gasless meta-transactions - Transaction clients (
EthereumTx,StarknetTx) for direct onchain interactions - Protocol-specific clients for Compound Governor Bravo and OpenZeppelin Governor
Type-Safe TypeScript
Fully typed interfaces with comprehensive TypeScript definitions for all methods and data structures.Package Structure
The SDK is organized into four main modules:Clients
Clients handle the creation and submission of governance actions. Available clients include:Strategies
Strategies define how voting power is calculated. The SDK includes built-in strategies for:- Vanilla: Simple token balance voting
- Comp: Compound-style checkpoint voting
- OZVotes: OpenZeppelin Votes standard
- Whitelist: Merkle tree-based whitelisting
- Cross-chain: Storage proof-based voting from other chains
Executors
Executors determine how approved proposals are executed onchain:- SimpleQuorumAvatar: Execute through a Gnosis Safe
- SimpleQuorumTimelock: Execute with a time delay
- Axiom: ZK-proof based execution
- Isokratia: Custom execution logic
- EthRelayer: Cross-chain execution via relayer
Utils
Utility functions for common operations:Use Cases
Creating a Governance Space
Submitting a Proposal (EVM)
Voting on a Proposal (Starknet)
Offchain Voting
Network Configurations
The SDK provides pre-configured network settings for all supported chains:- Chain ID and block time
- Deployed contract addresses (authenticators, strategies, executors)
- Network-specific parameters (gas settings, etc.)
Next Steps
- Installation - Set up the SDK in your project
- EVM Client - Learn about EVM client usage
- Starknet Client - Work with Starknet governance
- Offchain Client - Implement offchain voting
- Strategies - Understand voting power strategies
- Executors - Configure proposal execution