jupiter_api_rs/lib.rs
1//! Rust client for Jupiter APIs generated from the repository's OpenAPI specs.
2
3/// Generated client and types for endpoints hosted at `https://api.jup.ag`.
4#[path = "../generated/jupiter/mod.rs"]
5pub mod jupiter;
6
7/// Generated client and types for transaction submission at `https://tx.jup.ag`.
8#[path = "../generated/tx/mod.rs"]
9pub mod tx;
10
11/// Generated client for endpoints hosted at `https://api.jup.ag`.
12pub type JupiterApi = jupiter::HttpClient;
13
14/// Generated client for transaction submission at `https://tx.jup.ag`.
15pub type JupiterTxApi = tx::HttpClient;
16
17/// Creates a Jupiter API client configured with the required `x-api-key` header.
18pub fn create_jupiter_api(api_key: impl Into<String>) -> JupiterApi {
19 JupiterApi::new().with_api_key(api_key)
20}
21
22/// Creates a transaction-submission client configured with the required `x-api-key` header.
23pub fn create_jupiter_tx_api(api_key: impl Into<String>) -> JupiterTxApi {
24 JupiterTxApi::new().with_api_key(api_key)
25}