rrelayer rust sdk
The official SDK for interacting with rrelayer services.
rrelayer is an opensource powerful, high-performance blockchain transaction relay service built in Rust, designed for seamless integration with any EVM-compatible network. This tool transforms complex blockchain interactions into simple REST API calls, eliminating the need for applications to manage wallets, gas optimization, transaction queuing, or nonce management. For enterprise needs, rrelayer provides advanced wallet infrastructure with support for multiple secure signing providers including AWS KMS hardware security modules, Turnkey self-custody solutions, Privy-managed wallets, AWS Secrets Manager, GCP Secret Manager, and raw mnemonic development setups. It's highly scalable and production-ready, enabling you to build robust Web3 applications with enterprise-grade reliability and focus exclusively on your business logic. rrelayer out of the box gives you transaction relay, message signing, automated gas management, and real-time monitoring through intuitive APIs.
Usage
Create Client And Authentication
rrelayer has two ways to create clients based on the authentication direction, which is basic auth and API keys; we will explore both below.
Basic Auth
Using the basic authentication which uses the username and password in your api config
use FromStr;
use ;
// Client also exposes some admin methods in which API keys cannot do
let client = create_client;
let relayer: AdminRelayerClient = client.get_relayer_client.await?;
API Key Auth
Using API keys that have restricted permissions to only use the relayer - docs here
use FromStr;
use ;
let relayer: RelayerClient = create_relayer_client;
Full documentation can be found here