import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-Cet1W6Kq.cjs"; //#region ../../node_modules/.pnpm/@injectivelabs+platform-services-proto-ts-v2@1.0.8/node_modules/@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_positions_service_pb.d.ts /** * Persisted derivative position * * @generated from protobuf message positions_service.Position */ interface Position { /** * @generated from protobuf field: string id = 1 */ id: string; /** * @generated from protobuf field: string market_id = 2 */ marketId: string; /** * @generated from protobuf field: string account_address = 3 */ accountAddress: string; /** * @generated from protobuf field: string subaccount_id = 4 */ subaccountId: string; /** * @generated from protobuf field: string state = 5 */ state: string; /** * @generated from protobuf field: optional string close_reason = 6 */ closeReason?: string; /** * @generated from protobuf field: string side = 7 */ side: string; /** * @generated from protobuf field: string side_at_open = 8 */ sideAtOpen: string; /** * @generated from protobuf field: string pnl = 9 */ pnl: string; /** * @generated from protobuf field: string fees = 10 */ fees: string; /** * @generated from protobuf field: sint64 num_of_buy_trades = 12 */ numOfBuyTrades: bigint; /** * @generated from protobuf field: sint64 num_of_sell_trades = 13 */ numOfSellTrades: bigint; /** * @generated from protobuf field: sint64 total_trades = 14 */ totalTrades: bigint; /** * @generated from protobuf field: string avg_entry_price = 15 */ avgEntryPrice: string; /** * @generated from protobuf field: string quantity = 16 */ quantity: string; /** * @generated from protobuf field: string max_quantity = 17 */ maxQuantity: string; /** * @generated from protobuf field: string min_quantity = 18 */ minQuantity: string; /** * @generated from protobuf field: string initial_margin = 19 */ initialMargin: string; /** * @generated from protobuf field: string final_margin = 20 */ finalMargin: string; /** * @generated from protobuf field: string opened_at = 21 */ openedAt: string; /** * @generated from protobuf field: uint64 opened_height = 22 */ openedHeight: bigint; /** * @generated from protobuf field: string updated_at = 23 */ updatedAt: string; /** * @generated from protobuf field: uint64 updated_height = 24 */ updatedHeight: bigint; /** * @generated from protobuf field: optional string closed_at = 25 */ closedAt?: string; /** * @generated from protobuf field: optional uint64 closed_height = 26 */ closedHeight?: bigint; /** * @generated from protobuf field: sint64 duration_in_seconds = 27 */ durationInSeconds: bigint; /** * Quantity-weighted average execution price of reducing trades; zero before * the first reduction * * @generated from protobuf field: string exit_price = 28 */ exitPrice: string; /** * Realized PNL converted to USD, each realizing trade at the quote asset USD * oracle price in force at its block. * * @generated from protobuf field: string pnl_usd = 29 */ pnlUsd: string; } /** * A trade applied to a position * * @generated from protobuf message positions_service.PositionTrade */ interface PositionTrade { /** * @generated from protobuf field: string position_id = 1 */ positionId: string; /** * @generated from protobuf field: string event_type = 2 */ eventType: string; /** * @generated from protobuf field: string amount = 3 */ amount: string; /** * @generated from protobuf field: string execution_price = 4 */ executionPrice: string; /** * @generated from protobuf field: string timestamp = 5 */ timestamp: string; /** * @generated from protobuf field: string pnl = 6 */ pnl: string; /** * Realized PNL of the trade converted to USD at the quote asset USD oracle * price in force at its block. * * @generated from protobuf field: string pnl_usd = 7 */ pnlUsd: string; } /** * Daily realized PNL * * @generated from protobuf message positions_service.DailyPNL */ interface DailyPNL { /** * UTC date in YYYY-MM-DD format * * @generated from protobuf field: string date = 1 */ date: string; /** * @generated from protobuf field: string pnl = 2 */ pnl: string; /** * Realized PNL of the day converted to USD at the quote asset USD oracle price * of each realizing trade. * * @generated from protobuf field: string pnl_usd = 3 */ pnlUsd: string; } /** * Account-level rolling position stats * * @generated from protobuf message positions_service.AccountPositionStats */ interface AccountPositionStats { /** * @generated from protobuf field: string account_address = 1 */ accountAddress: string; /** * @generated from protobuf field: sint64 wins = 2 */ wins: bigint; /** * @generated from protobuf field: sint64 losses = 3 */ losses: bigint; /** * @generated from protobuf field: sint64 closed_positions = 4 */ closedPositions: bigint; /** * @generated from protobuf field: sint64 trade_count = 5 */ tradeCount: bigint; /** * @generated from protobuf field: string pnl = 6 */ pnl: string; /** * Realized PNL of positions closed in the selected window divided by the * summed positive initial margin of those same positions. Decimal ratio, not * percentage points: 0.25 means 25%. Zero when no position with positive * initial margin closed in the window. * * @generated from protobuf field: string pnl_percentage = 7 */ pnlPercentage: string; /** * @generated from protobuf field: string win_rate = 8 */ winRate: string; /** * @generated from protobuf field: string leverage = 9 */ leverage: string; /** * Maximum account-equity drawdown in the selected window. Account equity is * cumulative realized PNL and uses (peak equity - current equity) / peak * equity * 100, clamped to 0-100. Zero until equity has a positive peak. * * @generated from protobuf field: string max_drawdown = 10 */ maxDrawdown: string; /** * Cumulative realized PNL over the last 30 days, sampled hourly. Always this * span, whatever window is requested, so curves stay comparable between rows. * Flat at zero for an account with no activity in that period. * * @generated from protobuf field: repeated string equity_curve = 11 */ equityCurve: string[]; /** * Daily all-time account classifications: scalper, swing, long_term, * high_leverage, btc, bull, bear. * * @generated from protobuf field: repeated string tags = 12 */ tags: string[]; /** * One-based global rank by all-time PNL. Omitted when the account is not * ranked, which includes accounts with no closed position, and while the * ranking is rebuilding. * * @generated from protobuf field: optional sint64 rank = 13 */ rank?: bigint; /** * Truncated average lifetime in seconds for positions closed in the selected * window. * * @generated from protobuf field: sint64 avg_hold_duration_in_seconds = 14 */ avgHoldDurationInSeconds: bigint; /** * Opening and closing turnover for positions closed in the selected window. * * @generated from protobuf field: string total_volume = 15 */ totalVolume: string; /** * Realized PNL converted to USD, each realizing trade at the quote asset USD * oracle price in force at its block. Same window semantics as pnl. * * @generated from protobuf field: string pnl_usd = 16 */ pnlUsd: string; } /** * @generated MessageType for protobuf message positions_service.Position */ declare const Position = new Position$Type(); /** * @generated MessageType for protobuf message positions_service.PositionTrade */ declare const PositionTrade = new PositionTrade$Type(); /** * @generated MessageType for protobuf message positions_service.DailyPNL */ declare const DailyPNL = new DailyPNL$Type(); /** * @generated MessageType for protobuf message positions_service.AccountPositionStats */ declare const AccountPositionStats = new AccountPositionStats$Type(); //#endregion //#region ../../node_modules/.pnpm/@injectivelabs+platform-services-proto-ts-v2@1.0.8/node_modules/@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_injective_archiver_rpc_pb.d.ts /** * @generated from protobuf message injective_archiver_rpc.HistoricalTrade */ interface HistoricalTrade { /** * Account address * * @generated from protobuf field: string account = 1 */ account: string; /** * The subaccountId that executed the trade * * @generated from protobuf field: string subaccount_id = 2 */ subaccountId: string; /** * The ID of the market that this trade is in * * @generated from protobuf field: string market_id = 3 */ marketId: string; /** * The direction the trade * * @generated from protobuf field: string trade_direction = 4 */ tradeDirection: string; /** * Price level at which trade has been executed * * @generated from protobuf field: injective_archiver_rpc.PriceLevel price = 5 */ price?: PriceLevel; /** * The fee associated with the trade (quote asset denom) * * @generated from protobuf field: string fee = 6 */ fee: string; /** * Timestamp of trade execution in UNIX millis * * @generated from protobuf field: sint64 executed_at = 7 */ executedAt: bigint; /** * Block height of trade execution * * @generated from protobuf field: uint64 executed_height = 8 */ executedHeight: bigint; /** * Fee recipient address * * @generated from protobuf field: string fee_recipient = 9 */ feeRecipient: string; /** * Trade's execution side, maker,taker,n/a (n/a = not applicable) * * @generated from protobuf field: string execution_side = 10 */ executionSide: string; /** * USD value of the trade at the time of execution * * @generated from protobuf field: string usd_value = 11 */ usdValue: string; /** * A list of flag assigned to the trade * * @generated from protobuf field: repeated string flags = 12 */ flags: string[]; /** * Type of market * * @generated from protobuf field: string market_type = 13 */ marketType: string; /** * Unique trade ID * * @generated from protobuf field: string trade_id = 14 */ tradeId: string; /** * The execution type of the trade * * @generated from protobuf field: string execution_type = 15 */ executionType: string; /** * Client-provided unique identifier for the order * * @generated from protobuf field: string cid = 16 */ cid: string; /** * The funding rate at the time of the trade execution, applicable only for * derivative trades * * @generated from protobuf field: string funding_rate = 17 */ fundingRate: string; } /** * @generated from protobuf message injective_archiver_rpc.PriceLevel */ interface PriceLevel { /** * Price number of the price level. * * @generated from protobuf field: string price = 1 */ price: string; /** * Quantity of the price level. * * @generated from protobuf field: string quantity = 2 */ quantity: string; /** * Price level last updated timestamp in UNIX millis. * * @generated from protobuf field: sint64 timestamp = 3 */ timestamp: bigint; } /** * @generated MessageType for protobuf message injective_archiver_rpc.HistoricalTrade */ declare const HistoricalTrade = new HistoricalTrade$Type(); /** * @generated MessageType for protobuf message injective_archiver_rpc.PriceLevel */ declare const PriceLevel = new PriceLevel$Type(); //#endregion //#region ../../node_modules/.pnpm/@injectivelabs+platform-services-proto-ts-v2@1.0.8/node_modules/@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_charts_trading_view_service_pb.d.ts /** * @generated from protobuf message charts_trading_view_service.SpotMarketHistoryResponse */ interface SpotMarketHistoryResponse { /** * Status of the request: ok | no_data | error. * * @generated from protobuf field: string s = 1 */ s: string; /** * Bar open times, Unix timestamp (UTC). * * @generated from protobuf field: repeated sint32 t = 2 */ t: number[]; /** * Open prices. * * @generated from protobuf field: repeated double o = 3 */ o: number[]; /** * High prices. * * @generated from protobuf field: repeated double h = 4 */ h: number[]; /** * Low prices. * * @generated from protobuf field: repeated double l = 5 */ l: number[]; /** * Close prices. * * @generated from protobuf field: repeated double c = 6 */ c: number[]; /** * Quote-notional volumes. * * @generated from protobuf field: repeated double v = 7 */ v: number[]; } /** * Rolling market summary for a resolution window. * * @generated from protobuf message charts_trading_view_service.MarketSummaryResp */ interface MarketSummaryResp { /** * Market ID. * * @generated from protobuf field: string market_id = 1 */ marketId: string; /** * Open price. * * @generated from protobuf field: double open = 2 */ open: number; /** * High price. * * @generated from protobuf field: double high = 3 */ high: number; /** * Low price. * * @generated from protobuf field: double low = 4 */ low: number; /** * Quote-notional volume over the window. * * @generated from protobuf field: double volume = 5 */ volume: number; /** * Latest close price. * * @generated from protobuf field: double price = 6 */ price: number; /** * Change percent from opening price. * * @generated from protobuf field: double change = 7 */ change: number; } /** * @generated MessageType for protobuf message charts_trading_view_service.SpotMarketHistoryResponse */ declare const SpotMarketHistoryResponse = new SpotMarketHistoryResponse$Type(); /** * @generated MessageType for protobuf message charts_trading_view_service.MarketSummaryResp */ declare const MarketSummaryResp = new MarketSummaryResp$Type(); //#endregion //#region src/client/platformServices/types/platformServices.d.ts type PlatformServicesPositionsStatsWindow = '24h' | '7d' | '30d' | 'all_time'; type PlatformServicesPositionsSortBy = 'pnl' | 'trade_count' | 'num_trades' | 'win_rate' | 'avg_duration' | 'avg_hold_duration'; type PlatformServicesPositionsSortDirection = 'asc' | 'desc'; interface PlatformServicesListPositionsParams { /** * Position UUID filters. Repeat for multiple IDs, up to 100 supplied values. * Duplicates are ignored; unknown or invisible positions are omitted. * Cannot be combined with accountAddress, from, to, or txHash. * Repeat the same ID set on every page; results remain newest first. */ id?: string[]; to?: string; from?: string; pageSize?: number; nextToken?: string; accountAddress?: string; /** * Transaction hash filter. Returns the positions with at least one trade in * that transaction, so an RFQ fill resolves to the position it opened or * changed. 32-byte hex, with or without 0x, any case. Cannot be combined * with accountAddress, from, to, or id. Repeat it on every page; results * remain newest first. */ txHash?: string; } interface PlatformServicesGetAccountPositionStatsParams { accountAddress: string; window?: PlatformServicesPositionsStatsWindow; } interface PlatformServicesGetAccountDailyPNLParams { to: string; from: string; accountAddress: string; } interface PlatformServicesListAccountPositionStatsParams { to?: string; from?: string; tag?: string[]; pageSize?: number; nextToken?: string; accountAddress?: string[]; sortBy?: PlatformServicesPositionsSortBy; window?: PlatformServicesPositionsStatsWindow; sortDirection?: PlatformServicesPositionsSortDirection; } interface PlatformServicesListPositionTradesParams { positionId: string; pageSize?: number; nextToken?: string; sortDirection?: PlatformServicesPositionsSortDirection; } interface PlatformServicesGetAccountCountParams { window?: PlatformServicesPositionsStatsWindow; } interface PlatformServicesPosition { id: string; pnl: string; pnlUsd: string; side: string; fees: string; state: string; marketId: string; quantity: string; openedAt: string; updatedAt: string; closedAt?: string; sideAtOpen: string; totalTrades: string; maxQuantity: string; minQuantity: string; finalMargin: string; subaccountId: string; closeReason?: string; openedHeight: string; avgEntryPrice: string; initialMargin: string; exitPrice: string; updatedHeight: string; closedHeight?: string; accountAddress: string; numOfBuyTrades: string; numOfSellTrades: string; durationInSeconds: string; } interface PlatformServicesListPositionsResponse { positions: PlatformServicesPosition[]; nextToken?: string; } interface PlatformServicesPositionTrade { pnl: string; pnlUsd: string; amount: string; timestamp: string; eventType: string; positionId: string; executionPrice: string; } interface PlatformServicesListPositionTradesResponse { nextToken?: string; trades: PlatformServicesPositionTrade[]; } interface PlatformServicesAccountPositionStats { pnl: string; pnlUsd: string; wins: string; rank?: string; tags: string[]; losses: string; winRate: string; leverage: string; tradeCount: string; totalVolume: string; maxDrawdown: string; pnlPercentage: string; equityCurve: string[]; accountAddress: string; closedPositions: string; avgHoldDurationInSeconds: string; } interface PlatformServicesDailyPNL { pnl: string; pnlUsd: string; date: string; } interface PlatformServicesGetAccountDailyPNLResponse { accountAddress: string; dailyPnl: PlatformServicesDailyPNL[]; } interface PlatformServicesListAccountPositionStatsResponse { nextToken?: string; accounts: PlatformServicesAccountPositionStats[]; } interface PlatformServicesListAccountTagsResponse { tags: string[]; } interface PlatformServicesGetAccountCountResponse { totalAccounts: string; } type GrpcPlatformServicesPosition = Position; type GrpcPlatformServicesPositionTrade = PositionTrade; type GrpcPlatformServicesAccountPositionStats = AccountPositionStats; type GrpcPlatformServicesDailyPNL = DailyPNL; interface PlatformServicesMarketHistoryParams { resolution: string; to: number; symbol?: string; marketId?: string; from?: number; countback?: number; } interface PlatformServicesSpotMarketHistoryParams extends PlatformServicesMarketHistoryParams { fillGaps?: boolean; } interface PlatformServicesSpotMarketSummaryParams { marketId: string; resolution?: string; } interface PlatformServicesAllSpotMarketSummariesParams { resolution?: string; } interface PlatformServicesMarketHistory { s: string; t: number[]; o: number[]; h: number[]; l: number[]; c: number[]; v: number[]; } interface PlatformServicesSpotMarketSummary { marketId: string; open: number; high: number; low: number; volume: number; price: number; change: number; } interface PlatformServicesArchiverAccountParams { account: string; resolution?: string; } interface PlatformServicesArchiverAccountStatsParams { account: string; period?: string; } interface PlatformServicesHistoricalTradesParams { fromBlock?: bigint; endBlock?: bigint; fromTime?: bigint; endTime?: bigint; perPage?: number; token?: string; account?: string; executionTypes?: string[]; } interface PlatformServicesHistoricalDetailedBalance { spot: number; perp: number; staking: number; } interface PlatformServicesHistoricalBalance { t: number[]; v: number[]; dv: PlatformServicesHistoricalDetailedBalance[]; } interface PlatformServicesBalanceResponse { historicalBalance?: PlatformServicesHistoricalBalance; } interface PlatformServicesArchiverAccountStats { account: string; pnl: number; volume: number; stake: string; } interface PlatformServicesHistoricalDetailedPnl { rpnl: number; upnl: number; } interface PlatformServicesHistoricalRpnl { t: number[]; v: number[]; dv: PlatformServicesHistoricalDetailedPnl[]; } interface PlatformServicesRpnlResponse { historicalRpnl?: PlatformServicesHistoricalRpnl; } interface PlatformServicesArchiverPriceLevel { price: string; quantity: string; timestamp: string; } interface PlatformServicesHistoricalTrade { account: string; subaccountId: string; marketId: string; tradeDirection: string; price?: PlatformServicesArchiverPriceLevel; fee: string; executedAt: string; executedHeight: string; feeRecipient: string; executionSide: string; usdValue: string; flags: string[]; marketType: string; tradeId: string; executionType: string; cid: string; fundingRate: string; } interface PlatformServicesHistoricalTradesResponse { trades: PlatformServicesHistoricalTrade[]; lastHeight: string; lastTime: string; next: string[]; } type GrpcPlatformServicesChartMarketHistory = SpotMarketHistoryResponse; type GrpcPlatformServicesChartMarketSummary = MarketSummaryResp; type GrpcPlatformServicesHistoricalTrade = HistoricalTrade; //#endregion //#region src/client/platformServices/grpc/ArchiverGrpcApi.d.ts declare class ArchiverGrpcApi extends BaseGrpcConsumer { protected module: string; private get client(); fetchBalance(params: PlatformServicesArchiverAccountParams): Promise; fetchAccountStats(params: PlatformServicesArchiverAccountStatsParams): Promise; fetchRpnl(params: PlatformServicesArchiverAccountParams): Promise; fetchHistoricalTrades(params?: PlatformServicesHistoricalTradesParams): Promise; } //#endregion //#region src/client/platformServices/grpc/SocialTradingGrpcApi.d.ts declare class SocialTradingGrpcApi extends BaseGrpcConsumer { protected module: string; private get client(); fetchPositions(params?: PlatformServicesListPositionsParams): Promise; fetchPositionTrades(params: PlatformServicesListPositionTradesParams): Promise; fetchAccountPositionStats(params: PlatformServicesGetAccountPositionStatsParams): Promise; fetchAccountDailyPNL(params: PlatformServicesGetAccountDailyPNLParams): Promise; fetchAccountTags(): Promise; fetchAccountCount(params?: PlatformServicesGetAccountCountParams): Promise; fetchAccountPositionStatsList(params?: PlatformServicesListAccountPositionStatsParams): Promise; } //#endregion //#region src/client/platformServices/grpc/ChartsTradingViewGrpcApi.d.ts declare class ChartsTradingViewGrpcApi extends BaseGrpcConsumer { protected module: string; private get client(); fetchDerivativeMarketHistory(params: PlatformServicesMarketHistoryParams): Promise; fetchSpotMarketHistory(params: PlatformServicesSpotMarketHistoryParams): Promise; fetchSpotMarketSummary(params: PlatformServicesSpotMarketSummaryParams): Promise; fetchAllSpotMarketSummaries(params?: PlatformServicesAllSpotMarketSummariesParams): Promise; } //#endregion export { PlatformServicesHistoricalTradesResponse as A, PlatformServicesPosition as B, PlatformServicesGetAccountPositionStatsParams as C, PlatformServicesHistoricalRpnl as D, PlatformServicesHistoricalDetailedPnl as E, PlatformServicesListPositionTradesResponse as F, PlatformServicesRpnlResponse as G, PlatformServicesPositionsSortBy as H, PlatformServicesListPositionsParams as I, PlatformServicesSpotMarketSummaryParams as J, PlatformServicesSpotMarketHistoryParams as K, PlatformServicesListPositionsResponse as L, PlatformServicesListAccountPositionStatsResponse as M, PlatformServicesListAccountTagsResponse as N, PlatformServicesHistoricalTrade as O, PlatformServicesListPositionTradesParams as P, PlatformServicesMarketHistory as R, PlatformServicesGetAccountDailyPNLResponse as S, PlatformServicesHistoricalDetailedBalance as T, PlatformServicesPositionsSortDirection as U, PlatformServicesPositionTrade as V, PlatformServicesPositionsStatsWindow as W, PlatformServicesBalanceResponse as _, GrpcPlatformServicesChartMarketHistory as a, PlatformServicesGetAccountCountResponse as b, GrpcPlatformServicesHistoricalTrade as c, PlatformServicesAccountPositionStats as d, PlatformServicesAllSpotMarketSummariesParams as f, PlatformServicesArchiverPriceLevel as g, PlatformServicesArchiverAccountStatsParams as h, GrpcPlatformServicesAccountPositionStats as i, PlatformServicesListAccountPositionStatsParams as j, PlatformServicesHistoricalTradesParams as k, GrpcPlatformServicesPosition as l, PlatformServicesArchiverAccountStats as m, SocialTradingGrpcApi as n, GrpcPlatformServicesChartMarketSummary as o, PlatformServicesArchiverAccountParams as p, PlatformServicesSpotMarketSummary as q, ArchiverGrpcApi as r, GrpcPlatformServicesDailyPNL as s, ChartsTradingViewGrpcApi as t, GrpcPlatformServicesPositionTrade as u, PlatformServicesDailyPNL as v, PlatformServicesHistoricalBalance as w, PlatformServicesGetAccountDailyPNLParams as x, PlatformServicesGetAccountCountParams as y, PlatformServicesMarketHistoryParams as z };