get https://api.{env}.bluefin.io/v1/exchange/info
Returns the current exchange information including available margin assets, markets, and rules.
Client Library
#!/usr/bin/env python
import asyncio
import logging
from bluefin_pro_sdk import BluefinProSdk, Environment, RpcUrl
from crypto_helpers.signature import SuiWallet
# Set up logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
async def main():
"""
Example showing how to fetch exchange info from the Bluefin Pro API
using the PRODUCTION environment.
"""
# Create a wallet with your private key
sui_wallet = SuiWallet(
mnemonic= "YOUR_MNEMONIC_HERE" # Replace with your actual mnemonic phrase
)
log.info(f"Using wallet address: {sui_wallet.sui_address}")
# Initialize the Bluefin Pro SDK client with PRODUCTION environment and RPC
async with BluefinProSdk(
sui_wallet=sui_wallet,
contracts=None, # Not needed for this example
rpc_url=RpcUrl.PROD,
env=Environment.PRODUCTION,
debug=False # Set to True for more verbose output
) as client:
try:
# Initialize the client, which will handle authentication
await client.init()
# Get exchange info
exchange_info = await client.exchange_data_api.get_exchange_info()
# Log the exchange info
log.info("Exchange Information:")
log.info(f"{exchange_info=}")
# Return the exchange info for further use if needed
return exchange_info
except Exception as e:
log.error(f"Error fetching exchange info: {e}")
raise
if __name__ == "__main__":
try:
asyncio.run(main())
except KeyboardInterrupt:
log.info("Exiting due to keyboard interrupt")
use bluefin_api::apis::configuration::Configuration;
use bluefin_api::apis::exchange_api::get_exchange_info;
use bluefin_pro::prelude::*;
type Error = Box<dyn std::error::Error>;
type Result<T> = std::result::Result<T, Error>;
#[tokio::main]
async fn main() -> Result<()> {
let response = get_exchange_info(&Configuration {
base_path: exchange::mainnet::URL.into(),
..Configuration::default()
})
.await
}
HTTPs
Alternatively, call the GET /exchange/info endpoint using the integrated editor on the right or locally from any language supporting HTTPs network calls.