The OpenZeppelin Relayer SDK provides a TypeScript/JavaScript client for interacting with the OpenZeppelin Relayer service. This SDK allows developers to easily integrate relayer functionality into their applications for various blockchain networks.
- Node.js 22.14.0 or higher
- Package manager: pnpm 9.0.0 or higher
npm install @openzeppelin/relayer-sdk
# or
yarn add @openzeppelin/relayer-sdk
# or
pnpm add @openzeppelin/relayer-sdk
- Easy integration with OpenZeppelin Relayer services
- Support for multiple blockchain networks (EVM, Solana)
- TypeScript typings for better development experience
- Built-in configuration management
The SDK is built on top of an OpenAPI-generated TypeScript client that communicates with the OpenZeppelin Relayer API. It uses Axios for HTTP requests and provides type-safe interfaces for all API operations.
The SDK includes various examples demonstrating how to interact with relayers:
See the examples/evm directory for EVM-specific examples.
See the examples/solana directory for Solana-specific examples.
import { Configuration, RelayersApi } from '@openzeppelin/relayer-sdk';
const config = new Configuration({
basePath: 'https://your-path.com',
accessToken: '',
});
const relayersApi = new RelayersApi(config);
const relayer = await api.getRelayer('relayer-id');
console.log(relayer);
For more examples, check the examples directory.
The SDK is built on top of an OpenAPI specification which can be found in the openapi.json file.
For detailed API documentation, please refer to the API Reference in the docs folder. This documentation provides comprehensive information about all available endpoints, request parameters, and response types.
# Install dependencies
pnpm install
# Build the SDK
pnpm generate
The SDK client is generated from an OpenAPI specification file. To generate a new client:
- Create or update the
openapi.json
file in the root directory if it doesn't exist. - Run the generation command:
pnpm run generate
This command performs the following steps:
- Cleans the existing source files
- Generates a TypeScript Axios client from the OpenAPI specification
- Runs post-generation scripts to customize the output
- Builds the final client
pnpm test
Contributions are welcome! Please read our Code of Conduct before contributing to this project.
This project is licensed under the AGPL-3.0-or-later license. See the LICENSE file for more details.