A modular, production-grade blockchain SDK for provider, wallet, and smart contract interactions on any EVM chain.
Install RYT SDK via your preferred package manager:
npm install ryt-sdk
yarn add ryt-sdk
Create a .env file in your project root with the following configuration variables:
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
.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:
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.
RYT SDK sits cleanly between your application and the EVM, exposing a consistent abstraction layer across all modules:
Manages RPC connectivity and chain configuration. Accepts multiple RPC URLs for redundancy.
import RYTProvider from "ryt-sdk/provider";
const provider = new RYTProvider({
chainId: 1234,
rpcUrls: ["https://rpc-url"]
});
Handles private key management, transaction signing, and address derivation. Wraps a provider for broadcast capability.
import RYTWallet from "ryt-sdk/wallet";
const wallet = new RYTWallet(PRIVATE_KEY, provider);
console.log(wallet.getAddress()); // 0xYourAddress
The primary interface for smart contract interactions. Accepts any ABI and exposes a unified read/write API.
import RYTContract from "ryt-sdk/contract";
const contract = new RYTContract(address, abi, wallet);
Query on-chain state without submitting a transaction. Reads are instant and gas-free.
const name = await contract.read("name");
const symbol = await contract.read("symbol");
const decimals = await contract.read("decimals");
Submit state-changing transactions. Returns a transaction object with a .wait() method for confirmation handling.
const tx = await contract.write("transfer", to, 100n);
await tx.wait(); // Resolves when the tx is mined
Interact with any ERC20-compliant token. Transfer, approve, and manage allowances with a clean API.
const token = new RYTContract(address, ERC20.abi, wallet);
await token.write("transfer", recipient, 100n);
await token.write("approve", spender, 100n);
Mint and manage NFTs. Pass a TOKEN_URI to associate metadata with each minted token.
const nft = new RYTContract(address, ERC721.abi, wallet);
await nft.write("safeMint", wallet.getAddress(), TOKEN_URI);
Batch-mint fungible and non-fungible tokens in a single contract. Specify token ID and quantity.
const multi = new RYTContract(address, ERC1155.abi, wallet);
// mint(to, tokenId, amount)
await multi.write("mint", wallet.getAddress(), 1, 20);
Deploy any contract from its ABI and bytecode. Pass constructor arguments via the args array.
const contract = await deployer.deploy({
abi: ERC20.abi,
bytecode: ERC20.bytecode,
args: ["My Token", "MTK", 18, 1000000]
});
Use a MasterFactory contract to orchestrate deployments via CREATE, CREATE2, and EIP-1167 cloning from a single on-chain entry point.
const factory = await deployer.deploy({
abi: MasterFactory.abi,
bytecode: MasterFactory.bytecode,
args: [100]
});
const tx = await factory.write("deploySimple", 777);
await tx.wait();
const tx = await factory.write("deployCreate2", 999, salt);
await tx.wait();
const tx = await factory.write("deployClone", childAddr);
await tx.wait();
Deploy a minimal proxy clone directly using the deployer — no factory contract required.
const clone = await deployer.deployClone(address);
Deploy an upgradeable proxy using the UUPS pattern. Provide implementation bytecode and initialization calldata.
const proxy = await deployer.deployUUPS({
implementationAbi,
implementationBytecode,
initData
});
await proxy.write("setValue", 100);
Deploy contracts to a predictable address derived from your bytecode and salt — useful for cross-chain parity.
const result = await deployer.deployCreate2({
factoryAddress: CREATE2_FACTORY,
abi: ERC20.abi,
bytecode: ERC20.bytecode,
salt,
args: ["My Token", "MTK", 18, 1000000]
});
Link external Solidity libraries into your contract bytecode before deployment. Specify precise byte offsets and library addresses.
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:
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.
}
Insufficient gas, contract reverts, invalid ABI methods, and provider connectivity issues will all surface as catchable errors with descriptive messages.
| Category | Feature | Status | Description |
|---|---|---|---|
| Core | Provider | Active | RPC connection & chain interaction layer |
| Core | Wallet | Active | Private key management & signing |
| Core | Contract Read/Write | Active | Unified smart contract interaction API |
| Tokens | ERC20 | Active | Fungible token standard support |
| Tokens | ERC721 | Active | NFT (non-fungible token) support |
| Tokens | ERC1155 | Active | Multi-token standard support |
| Deployment | CREATE | Active | Standard contract deployment |
| Deployment | CREATE2 | Active | Deterministic contract deployment |
| Proxy Systems | UUPS Proxy | Active | Upgradeable contract architecture |
| Proxy Systems | Cloning (EIP-1167) | Active | Minimal proxy factory cloning |
| Advanced | Library Linking | Active | Solidity library linking support |
| Advanced | Internal Transactions | Active | Internal execution tracing support |
| Advanced | Payable Functions | Active | ETH value transfer support |
RYT SDK ships with a comprehensive test suite covering all modules, token standards, deployment patterns, and edge cases:
# Run unit tests
npm test
# Run full contract integration tests
npm run contractsTest
Test coverage includes: