This documentation is restricted to authorised members of the SWSS Developer Community. Access is granted exclusively through SWSS DevHub, after KYB and SWSS Foundation approval.
All SwssChain GitHub repositories are private. Significant updates are currently deploying across the full SWSS Ecosystem. SDK and API specifications are subject to change at any time in accordance with security requirements and SwssChain Foundation governance decisions.
SWSS SDK v2.1 is deploying across the ecosystem. API signatures may change during this period. Ensure your integration uses the latest schema from SWSS DevHub.
SDK Overview and Installation
The SwssChain Developer SDK suite provides language-native libraries for integrating applications with the SwssChain network. SDKs abstract low-level JSON-RPC calls, cryptographic signing, and nonce management, allowing developers to focus on application logic rather than protocol mechanics.
SDK Philosophy
SwssChain SDKs are built around three principles: correctness over convenience, explicit over implicit, and minimal external dependencies. Each SDK exposes the full surface of the SwssChain protocol without hiding complexity behind opaque abstractions.
All SDKs are EVM-compatible and interoperate with standard Ethereum tooling. The SwssChain-specific extensions (Deed settlement, Finality Certificate retrieval, and Settlement Combustion Model telemetry) are layered on top of standard EVM interfaces.
Supported Languages and Packages
| Language | Package | Install Command | Status |
|---|---|---|---|
| JavaScript / TypeScript | @swsschain/sdk | npm install @swsschain/sdk | Stable |
| Python | swsschain-sdk | pip install swsschain-sdk | Stable |
| Go | github.com/swsschain/go-sdk | go get github.com/swsschain/go-sdk | Stable |
| Rust | swsschain | cargo add swsschain | Beta |
Network Configuration
All SDKs require a network configuration object that specifies which SwssChain network to connect to. The two networks available during the testing period are mainnet and testnet.
{
"mainnet": {
"chainId": 122605,
"chainIdHex": "0x1DEED",
"rpcUrl": "${SWSSCHAIN_RPC_URL}",
"wsUrl": "${SWSSCHAIN_WS_URL}",
"explorerUrl": "https://swssscan.swss.io",
"blockTime": 1,
"nativeCurrency": {
"name": "SWSS Coin",
"symbol": "SWSS",
"decimals": 18
}
},
"testnet": {
"chainId": 122606,
"chainIdHex": "0x1DEEE",
"rpcUrl": "${SWSSCHAIN_TESTNET_RPC_URL}",
"wsUrl": "${SWSSCHAIN_TESTNET_WS_URL}",
"explorerUrl": "https://testnet.swssscan.swss.io",
"blockTime": 1,
"nativeCurrency": {
"name": "SWSS Coin",
"symbol": "SWSS",
"decimals": 18
}
}
}
Authentication and API Keys
Most read operations against the public RPC endpoint do not require authentication. Write operations (submitting transactions, creating Deed settlements) require a funded account and valid private key. The SwssChain RPC node does not expose API key management; rate limiting is applied per IP address.
For high-throughput applications requiring dedicated rate limits, contact the SwssChain infrastructure team via the developer portal.
Quick Start: JavaScript
import { SwssChain, networks } from '@swsschain/sdk';
// Connect to testnet for development
const client = new SwssChain({
network: networks.testnet,
privateKey: process.env.PRIVATE_KEY // Never hardcode private keys
});
async function main() {
const blockNumber = await client.getBlockNumber();
console.log('Current block:', blockNumber);
const balance = await client.getBalance('0xYourAddressHere');
console.log('Balance:', client.formatSWSSCoin(balance), 'SWSS');
}
main().catch(console.error);
Quick Start: Python
from swsschain import SwssChain, networks
import os
client = SwssChain(
network=networks.testnet,
private_key=os.environ.get('PRIVATE_KEY')
)
block = client.get_block_number()
print(f'Current block: {block}')
balance = client.get_balance('0xYourAddressHere')
print(f'Balance: {client.format_swss_coin(balance)} SWSS')
Quick Start: Go
package main
import (
"fmt"
"log"
"os"
swsschain "github.com/swsschain/go-sdk"
)
func main() {
client, err := swsschain.NewClient(&swsschain.Config{
Network: swsschain.Testnet,
PrivateKey: os.Getenv("PRIVATE_KEY"),
})
if err != nil {
log.Fatal(err)
}
blockNumber, err := client.GetBlockNumber()
if err != nil {
log.Fatal(err)
}
fmt.Printf("Current block: %d\n", blockNumber)
}
Versioning Policy
All SwssChain SDKs follow semantic versioning. Breaking changes are introduced only in major versions and are announced with a minimum 60-day deprecation notice. Minor versions add features in a backward-compatible manner. Patch versions contain bug fixes only.
The SDK changelog is maintained separately and lists every change by version with migration guidance for breaking changes.
Development vs Production
Use testnet (Chain ID 122606) for all development and integration testing. Testnet SWSS Coin has no monetary value and is available via the developer faucet. Do not submit real Deed transactions against testnet: testnet Deed records are periodically purged and are not acknowledged by the SwssChain settlement layer.
Switch to mainnet (Chain ID 122605) only for production deployments with real asset records.
