The Move Pricing API provides functionality to interact with price data for Move-based blockchains.
import { Pricing } from "@noves/noves-sdk";
// Initialize the Move pricing client
const movePricing = Pricing.move("YOUR_API_KEY");Returns a list of supported Move chains.
const chains = await movePricing.getChains();
// Returns: [{ name: "sui", ecosystem: "move", nativeCoin: {...} }, ...]interface MOVEPricingChain {
name: string;
ecosystem: string;
nativeCoin: {
name: string;
symbol: string;
address: string;
decimals: number;
};
}Get the price for a token from a specific liquidity pool.
// Get price from a specific pool
const priceFromPool = await movePricing.getPriceFromPool(
"sui",
"0xdeacf7ab460385d4bcb567f183f916367f7d43666a2c72323013822eb3c57026", // SUI-BUCK Aftermath Finance pool
"0x2::sui::SUI" // SUI token
);chain(string): The chain name (e.g., "sui")poolAddress(string): The address of the liquidity poolbaseTokenAddress(string): The address of the base token to get the price for
interface MOVEPricingPoolResponse {
chain: string;
exchange: {
name: string;
};
poolAddress: string;
baseToken: {
address: string;
symbol: string;
name: string;
decimals: number;
};
quoteToken: {
address: string;
symbol: string;
name: string;
decimals: number;
};
price: {
amount: string;
};
}{
"chain": "sui",
"exchange": {
"name": "Aftermath Finance"
},
"poolAddress": "0xdeacf7ab460385d4bcb567f183f916367f7d43666a2c72323013822eb3c57026",
"baseToken": {
"address": "0x2::sui::SUI",
"symbol": "SUI",
"name": "Sui",
"decimals": 9
},
"quoteToken": {
"address": "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",
"symbol": "BUCK",
"name": "Bucket USD",
"decimals": 9
},
"price": {
"amount": "2.911229208"
}
}The SDK throws specific errors for common scenarios:
InvalidApiKeyError: Thrown when an invalid API key is providedRateLimitError: Thrown when the API rate limit is exceeded404 Error: Thrown when an invalid pool address or token address is provided
The Move Pricing API uses strict typing based on actual API responses:
- All fields return actual values (no nullable fields)
- Chain information uses
MOVEPricingChaininterface - Pool pricing responses use
MOVEPricingPoolResponseinterface - Native coin information follows the actual API response structure
- API either returns valid data or throws an error (no partial/null responses)