v1.0.0 - Stable

RYT SDK

A modular, production-grade blockchain SDK for provider, wallet, and smart contract interactions on any EVM chain.

MIT License EVM Compatible TypeScript Ready Production Grade

Install RYT SDK via your preferred package manager:

npm

bash
npm install ryt-sdk

yarn

bash
yarn add ryt-sdk

Create a .env file in your project root with the following configuration variables:

.env
PRIVATE_KEY=your_private_key
RPC_URL=https://your-rpc-url
CHAIN_ID=1234

TOKEN_URI=https://metadata.example.com
CREATE2_FACTORY=0xFactoryAddress
SALT=random_salt
MATH_LIB_ADDRESS=0xLibraryAddress
Never commit your .env file to version control. Add it to your .gitignore to keep your private keys and secrets secure.

Get up and running in seconds. Import the three core modules, initialize your provider and wallet, then interact with any smart contract:

javascript
import RYTProvider from "ryt-sdk/provider";
import RYTWallet  from "ryt-sdk/wallet";
import RYTContract from "ryt-sdk/contract";

// 1. Initialize provider with your chain config
const provider = new RYTProvider({
  chainId: process.env.CHAIN_ID,
  rpcUrls: [process.env.RPC_URL]
});

// 2. Create a wallet from private key
const wallet = new RYTWallet(process.env.PRIVATE_KEY, provider);

// 3. Attach a contract instance
const contract = new RYTContract(address, abi, wallet);

// 4. Execute a transaction and wait for confirmation
const tx = await contract.write("transfer", to, 100n);
await tx.wait();

RYT SDK is a modular blockchain development toolkit engineered to simplify every layer of EVM development — from reading on-chain state to deploying complex upgradeable proxy architectures.

Smart Contracts
Unified read/write API for any ABI-compatible contract
Wallet Mgmt
Private key management, signing, and address derivation
Deployment
CREATE and CREATE2 deterministic contract deployment
Token Standards
Full ERC20, ERC721, and ERC1155 support out of the box
Proxy Patterns
UUPS upgradeable contracts with full lifecycle support
Cloning
EIP-1167 minimal proxy cloning for gas-efficient deploys
Library Linking
Solidity external library linking and bytecode injection

RYT SDK sits cleanly between your application and the EVM, exposing a consistent abstraction layer across all modules:

Your Application
RYT SDK Core
Provider
Wallet
Contract
Deployment Engine
RYT / Ethereum / Any EVM Chain

Provider

Manages RPC connectivity and chain configuration. Accepts multiple RPC URLs for redundancy.

javascript
import RYTProvider from "ryt-sdk/provider";

const provider = new RYTProvider({
  chainId: 1234,
  rpcUrls: ["https://rpc-url"]
});

Wallet

Handles private key management, transaction signing, and address derivation. Wraps a provider for broadcast capability.

javascript
import RYTWallet from "ryt-sdk/wallet";

const wallet = new RYTWallet(PRIVATE_KEY, provider);

console.log(wallet.getAddress()); // 0xYourAddress

Contract

The primary interface for smart contract interactions. Accepts any ABI and exposes a unified read/write API.

javascript
import RYTContract from "ryt-sdk/contract";

const contract = new RYTContract(address, abi, wallet);

Read Contract Data

Query on-chain state without submitting a transaction. Reads are instant and gas-free.

javascript
const name     = await contract.read("name");
const symbol   = await contract.read("symbol");
const decimals = await contract.read("decimals");

Write Transactions

Submit state-changing transactions. Returns a transaction object with a .wait() method for confirmation handling.

javascript
const tx = await contract.write("transfer", to, 100n);
await tx.wait(); // Resolves when the tx is mined

ERC20 — Fungible Tokens

Interact with any ERC20-compliant token. Transfer, approve, and manage allowances with a clean API.

javascript
const token = new RYTContract(address, ERC20.abi, wallet);

await token.write("transfer", recipient, 100n);
await token.write("approve", spender, 100n);

ERC721 — Non-Fungible Tokens

Mint and manage NFTs. Pass a TOKEN_URI to associate metadata with each minted token.

javascript
const nft = new RYTContract(address, ERC721.abi, wallet);

await nft.write("safeMint", wallet.getAddress(), TOKEN_URI);

ERC1155 — Multi-Token Standard

Batch-mint fungible and non-fungible tokens in a single contract. Specify token ID and quantity.

javascript
const multi = new RYTContract(address, ERC1155.abi, wallet);

// mint(to, tokenId, amount)
await multi.write("mint", wallet.getAddress(), 1, 20);

Standard Deployment (CREATE)

Deploy any contract from its ABI and bytecode. Pass constructor arguments via the args array.

javascript
const contract = await deployer.deploy({
  abi:      ERC20.abi,
  bytecode: ERC20.bytecode,
  args:     ["My Token", "MTK", 18, 1000000]
});

Factory Deployments

Use a MasterFactory contract to orchestrate deployments via CREATE, CREATE2, and EIP-1167 cloning from a single on-chain entry point.

Deploy Master Factory

javascript
const factory = await deployer.deploy({
  abi:      MasterFactory.abi,
  bytecode: MasterFactory.bytecode,
  args:     [100]
});

CREATE via Factory

javascript
const tx = await factory.write("deploySimple", 777);
await tx.wait();

CREATE2 via Factory

javascript
const tx = await factory.write("deployCreate2", 999, salt);
await tx.wait();

Cloning (EIP-1167) via Factory

javascript
const tx = await factory.write("deployClone", childAddr);
await tx.wait();

Cloning Without Factory (EIP-1167)

Deploy a minimal proxy clone directly using the deployer — no factory contract required.

javascript
const clone = await deployer.deployClone(address);

UUPS Proxy

Deploy an upgradeable proxy using the UUPS pattern. Provide implementation bytecode and initialization calldata.

javascript
const proxy = await deployer.deployUUPS({
  implementationAbi,
  implementationBytecode,
  initData
});

await proxy.write("setValue", 100);

Deterministic Deployment (CREATE2)

Deploy contracts to a predictable address derived from your bytecode and salt — useful for cross-chain parity.

javascript
const result = await deployer.deployCreate2({
  factoryAddress: CREATE2_FACTORY,
  abi:            ERC20.abi,
  bytecode:       ERC20.bytecode,
  salt,
  args:           ["My Token", "MTK", 18, 1000000]
});

Library Linking

Link external Solidity libraries into your contract bytecode before deployment. Specify precise byte offsets and library addresses.

javascript
const lib = await deployer.deployWithLibraries({
  abi:      Calculator.abi,
  bytecode: Calculator.bytecode,
  linkReferences: {
    "contracts/ryt/MathLib.sol": {
      MathLib: [{ length: 20, start: 283 }]
    }
  },
  libraries: {
    MathLib: MATH_LIB_ADDRESS
  }
});

All async SDK methods throw on failure. Wrap calls in try/catch blocks to gracefully handle reverts, network errors, and gas estimation failures:

javascript
try {
  const tx = await contract.write("transfer", to, amount);
  await tx.wait();
} catch (err) {
  console.error("Transaction failed:", err);
  // Handle revert reasons, gas errors, etc.
}
Common Errors

Insufficient gas, contract reverts, invalid ABI methods, and provider connectivity issues will all surface as catchable errors with descriptive messages.

Category Feature Status Description
CoreProviderActiveRPC connection & chain interaction layer
CoreWalletActivePrivate key management & signing
CoreContract Read/WriteActiveUnified smart contract interaction API
TokensERC20ActiveFungible token standard support
TokensERC721ActiveNFT (non-fungible token) support
TokensERC1155ActiveMulti-token standard support
DeploymentCREATEActiveStandard contract deployment
DeploymentCREATE2ActiveDeterministic contract deployment
Proxy SystemsUUPS ProxyActiveUpgradeable contract architecture
Proxy SystemsCloning (EIP-1167)ActiveMinimal proxy factory cloning
AdvancedLibrary LinkingActiveSolidity library linking support
AdvancedInternal TransactionsActiveInternal execution tracing support
AdvancedPayable FunctionsActiveETH value transfer support

RYT SDK ships with a comprehensive test suite covering all modules, token standards, deployment patterns, and edge cases:

bash
# Run unit tests
npm test

# Run full contract integration tests
npm run contractsTest

Test coverage includes:

ERC20 ERC721 ERC1155 CREATE deployment CREATE2 deployment UUPS Proxy Cloning (EIP-1167) Payable Functions Library Linking Internal Transactions
Modular Architecture
Import only what you need. Provider, Wallet, and Contract are fully independent modules.
Advanced EVM Patterns
First-class support for UUPS proxies, CREATE2, EIP-1167 cloning, and library linking.
Production Ready
Designed for real-world systems with comprehensive error handling and full test coverage.
EVM Universal
Works with any EVM-compatible chain — Ethereum, Polygon, Base, Arbitrum, and custom networks.