@cranberry-money/shared-types
Version:
Shared TypeScript type definitions for Blueberry platform
98 lines • 2.82 kB
TypeScript
import type { BaseQueryParams, TimeSeriesQueryParams } from '../api';
/**
* Asset type classification - must match backend AssetType enum in assets/models/asset.py
*/
export declare enum AssetType {
NATIVE_CRYPTO = "native_crypto",
ERC20_TOKEN = "erc20_token",
STABLECOIN = "stablecoin",
TOKENIZED_SECURITY = "tokenized_security",
TOKENIZED_RWA = "tokenized_rwa",
SYNTHETIC = "synthetic"
}
export declare enum SettlementPermission {
PERMISSIONLESS = "permissionless",
PERMISSIONED = "permissioned"
}
export declare enum RegulatoryClassification {
SECURITY = "security",
PAYMENT_TOKEN = "payment_token",
DERIVATIVE = "derivative",
UTILITY_TOKEN = "utility_token"
}
export declare enum PriceSource {
OFF_CHAIN_API = "off_chain_api",
ON_CHAIN_ORACLE = "on_chain_oracle",
MANUAL = "manual"
}
export interface Asset {
uuid: string;
symbol: string;
name: string;
assetType: string;
assetTypeDisplay?: string;
settlementPermission?: SettlementPermission | string;
regulatoryClassification?: RegulatoryClassification | string;
chain: string | null;
contractAddress: string | null;
decimals: number;
underlyingTicker?: string | null;
issuerName?: string | null;
isin?: string | null;
currentPrice: string | null;
priceCurrency: string;
priceSource?: PriceSource | string;
isActive: boolean;
createdAt: string;
updatedAt: string;
}
/**
* Query parameters for asset endpoints
*
* NAMING CONVENTION: Query params use snake_case following REST API URL standards.
*/
export interface AssetQueryParams extends BaseQueryParams {
uuid?: string;
symbol?: string;
name?: string;
asset_type?: string;
settlement_permission?: string;
chain?: string;
contract_address?: string;
underlying_ticker?: string;
is_active?: 'true' | 'false';
min_price?: number;
max_price?: number;
search?: string;
}
export interface AssetSnapshot {
uuid: string;
asset: string;
assetName: string;
assetSymbol: string;
price: string;
change: string;
changePercent: string;
sourceTimestamp: string;
}
/**
* Query parameters for asset snapshot endpoints.
* Extends TimeSeriesQueryParams for limit-based pagination with date range filtering.
*
* NAMING CONVENTION: Query params use snake_case following REST API URL standards.
*/
export interface AssetSnapshotQueryParams extends TimeSeriesQueryParams {
asset?: string;
min_price?: number;
max_price?: number;
}
/**
* Client-side filter state for asset lists.
* Simpler than AssetQueryParams which includes all API query parameters.
*/
export interface AssetFilters {
search?: string;
asset_type?: string;
chain?: string;
}
//# sourceMappingURL=asset.d.ts.map