import { AccountCode } from "../../gen/ledger/v1/catalog_pb.js"; import { BalanceRange as BalanceRange$1, EquityGroupBy as EquityGroupBy$1 } from "../../gen/ledger/read/v1/ledger_read_pb.js"; import { DecodedEnum } from "../../utils/types.js"; import { SdkScales } from "../../shared/decimal-surface.js"; import { U128Value } from "../../utils/u128.js"; import { AccountCodeValue } from "../../shared/ledger-codes.js"; import * as v from "valibot"; //#region src/services/balances/balances.schemas.d.ts /** * AssetBalance u128 fields on the ledger wire are always 18-decimal scaled * (PolyesterChain base units), independent of per-asset quantityScale used * elsewhere for order quantities and transfer inputs. */ declare function createLedgerBalanceSchema(): v.SchemaWithPipe; readonly trading: v.SchemaWithPipe; readonly lo: v.BigintSchema; }, undefined>, undefined>, v.TransformAction]>; readonly funding: v.SchemaWithPipe; readonly lo: v.BigintSchema; }, undefined>, undefined>, v.TransformAction]>; readonly reserved: v.SchemaWithPipe; readonly lo: v.BigintSchema; }, undefined>, undefined>, v.TransformAction]>; readonly available: v.SchemaWithPipe; readonly lo: v.BigintSchema; }, undefined>, undefined>, v.TransformAction]>; readonly tradingRevision: v.SchemaWithPipe, 0n>, v.TransformAction]>; readonly fundingRevision: v.SchemaWithPipe, 0n>, v.TransformAction]>; }, undefined>, v.TransformAction<{ assetId: number; trading?: bigint | undefined; funding?: bigint | undefined; reserved?: bigint | undefined; available?: bigint | undefined; tradingRevision: string; fundingRevision: string; }, { assetId: number; funding: string; trading: string; reserved: string; available: string; tradingRevision: string; fundingRevision: string; }>]>; type LedgerBalance = v.InferOutput>; declare const BalanceRangeSchema: v.PicklistSchema; type BalanceRange = v.InferOutput; declare const EquityGroupBySchema: v.PicklistSchema; type EquityGroupBy = v.InferOutput; declare const BalanceHistoryInputSchema: v.SchemaWithPipe, v.TransformAction<"1d" | "7d" | "30d" | "90d" | "180d" | "365d", BalanceRange$1.DAY_1 | BalanceRange$1.DAY_7 | BalanceRange$1.DAY_30 | BalanceRange$1.DAY_90 | BalanceRange$1.DAY_180 | BalanceRange$1.DAY_365>]>; readonly ledger: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, 0>; readonly accountCodes: v.OptionalSchema, v.TransformAction<"funding" | "trading", AccountCode.FUNDING | AccountCode.TRADING>]>, undefined>, readonly []>; readonly account: v.OptionalSchema, v.StrictObjectSchema<{ readonly subaccountId: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction]>; }, undefined>], undefined>, undefined>; }, undefined>, v.TransformAction<{ range: BalanceRange$1.DAY_1 | BalanceRange$1.DAY_7 | BalanceRange$1.DAY_30 | BalanceRange$1.DAY_90 | BalanceRange$1.DAY_180 | BalanceRange$1.DAY_365; ledger: number; accountCodes: (AccountCode.FUNDING | AccountCode.TRADING)[]; account?: "active" | "main" | { subaccountId: string; } | undefined; }, { subaccountId: bigint | undefined; range: BalanceRange$1.DAY_1 | BalanceRange$1.DAY_7 | BalanceRange$1.DAY_30 | BalanceRange$1.DAY_90 | BalanceRange$1.DAY_180 | BalanceRange$1.DAY_365; ledger: number; accountCodes: (AccountCode.FUNDING | AccountCode.TRADING)[]; }>]>; type BalanceHistoryInput = v.InferInput; declare function createBalanceHistoryResponseSchema(): v.SchemaWithPipe, v.TransformAction]>; readonly bucket: v.StringSchema; readonly startTsSec: v.NumberSchema; readonly endTsSec: v.NumberSchema; readonly points: v.NumberSchema; readonly series: v.ArraySchema; readonly accountCode: v.EnumSchema<{ funding: AccountCode.FUNDING; trading: AccountCode.TRADING; }, undefined>; readonly balanceQ: v.ArraySchema, undefined>; }, undefined>, undefined>; }, undefined>, v.TransformAction<{ range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d"; bucket: string; startTsSec: number; endTsSec: number; points: number; series: { assetId: number; accountCode: v.EnumValues<{ funding: AccountCode.FUNDING; trading: AccountCode.TRADING; }>; balanceQ: bigint[]; }[]; }, { range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d"; bucket: string; startTsSec: number; endTsSec: number; points: number; series: { assetId: number; accountCode: "unspecified" | "funding" | "trading"; balance: string[]; }[]; }>]>; type BalanceHistoryResponse = v.InferOutput>; declare const EquityHistoryInputSchema: v.SchemaWithPipe, v.TransformAction<"1d" | "7d" | "30d" | "90d" | "180d" | "365d", BalanceRange$1.DAY_1 | BalanceRange$1.DAY_7 | BalanceRange$1.DAY_30 | BalanceRange$1.DAY_90 | BalanceRange$1.DAY_180 | BalanceRange$1.DAY_365>]>; readonly accountCodes: v.OptionalSchema, v.TransformAction<"funding" | "trading", AccountCode.FUNDING | AccountCode.TRADING>]>, undefined>, readonly []>; readonly groupBy: v.SchemaWithPipe, "account">, v.TransformAction<"account" | "asset", EquityGroupBy$1.GROUP_BY_ACCOUNT | EquityGroupBy$1.GROUP_BY_ASSET>]>; readonly account: v.OptionalSchema, v.StrictObjectSchema<{ readonly subaccountId: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction]>; }, undefined>], undefined>, undefined>; }, undefined>, v.TransformAction<{ range: BalanceRange$1.DAY_1 | BalanceRange$1.DAY_7 | BalanceRange$1.DAY_30 | BalanceRange$1.DAY_90 | BalanceRange$1.DAY_180 | BalanceRange$1.DAY_365; accountCodes: (AccountCode.FUNDING | AccountCode.TRADING)[]; groupBy: EquityGroupBy$1.GROUP_BY_ACCOUNT | EquityGroupBy$1.GROUP_BY_ASSET; account?: "active" | "main" | { subaccountId: string; } | undefined; }, { subaccountId: bigint | undefined; range: BalanceRange$1.DAY_1 | BalanceRange$1.DAY_7 | BalanceRange$1.DAY_30 | BalanceRange$1.DAY_90 | BalanceRange$1.DAY_180 | BalanceRange$1.DAY_365; accountCodes: (AccountCode.FUNDING | AccountCode.TRADING)[]; groupBy: EquityGroupBy$1.GROUP_BY_ACCOUNT | EquityGroupBy$1.GROUP_BY_ASSET; }>]>; type EquityHistoryInput = v.InferInput; declare const PortfolioEquityHistoryInputSchema: v.StrictObjectSchema<{ readonly range: v.SchemaWithPipe, v.TransformAction<"1d" | "7d" | "30d" | "90d" | "180d" | "365d", BalanceRange$1.DAY_1 | BalanceRange$1.DAY_7 | BalanceRange$1.DAY_30 | BalanceRange$1.DAY_90 | BalanceRange$1.DAY_180 | BalanceRange$1.DAY_365>]>; }, undefined>; type PortfolioEquityHistoryInput = v.InferInput; type EquitySeriesGrouping = { type: "account"; accountCode: DecodedEnum; name: string; } | { type: "asset"; assetId: number; symbol: string; }; declare const EquitySeriesSchema: v.SchemaWithPipe; readonly value: v.ObjectSchema<{ readonly accountCode: v.EnumSchema<{ funding: AccountCode.FUNDING; trading: AccountCode.TRADING; }, undefined>; readonly name: v.StringSchema; }, undefined>; }, undefined>, v.ObjectSchema<{ readonly case: v.LiteralSchema<"asset", undefined>; readonly value: v.ObjectSchema<{ readonly id: v.NumberSchema; readonly symbol: v.StringSchema; }, undefined>; }, undefined>], undefined>; readonly equityQ: v.ArraySchema, undefined>; }, undefined>, v.TransformAction<{ grouping: { case: "account"; value: { accountCode: v.EnumValues<{ funding: AccountCode.FUNDING; trading: AccountCode.TRADING; }>; name: string; }; } | { case: "asset"; value: { id: number; symbol: string; }; }; equityQ: bigint[]; }, { grouping: EquitySeriesGrouping; equity: string[]; }>]>; declare function createEquityHistoryResponseSchema(scales: SdkScales): v.SchemaWithPipe, v.TransformAction]>; readonly bucket: v.StringSchema; readonly startTsSec: v.NumberSchema; readonly endTsSec: v.NumberSchema; readonly quoteAsset: v.StringSchema; readonly points: v.NumberSchema; readonly series: v.ArraySchema; readonly value: v.ObjectSchema<{ readonly accountCode: v.EnumSchema<{ funding: AccountCode.FUNDING; trading: AccountCode.TRADING; }, undefined>; readonly name: v.StringSchema; }, undefined>; }, undefined>, v.ObjectSchema<{ readonly case: v.LiteralSchema<"asset", undefined>; readonly value: v.ObjectSchema<{ readonly id: v.NumberSchema; readonly symbol: v.StringSchema; }, undefined>; }, undefined>], undefined>; readonly equityQ: v.ArraySchema, undefined>; }, undefined>, v.TransformAction<{ grouping: { case: "account"; value: { accountCode: v.EnumValues<{ funding: AccountCode.FUNDING; trading: AccountCode.TRADING; }>; name: string; }; } | { case: "asset"; value: { id: number; symbol: string; }; }; equityQ: bigint[]; }, { grouping: EquitySeriesGrouping; equity: string[]; }>]>, undefined>; readonly btcPricesQ: v.OptionalSchema, undefined>, readonly []>; }, undefined>, v.TransformAction<{ range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d"; bucket: string; startTsSec: number; endTsSec: number; quoteAsset: string; points: number; series: { grouping: EquitySeriesGrouping; equity: string[]; }[]; btcPricesQ: bigint[]; }, { range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d"; bucket: string; startTsSec: number; endTsSec: number; quoteAsset: string; points: number; series: { grouping: EquitySeriesGrouping; equity: string[]; }[]; btcPrices: string[]; }>]>; type EquitySeries = v.InferOutput; type EquityHistoryResponse = v.InferOutput>; type PortfolioEquitySeriesGrouping = { type: "portfolioAccount"; accountId: string; remaining: false; } | { type: "portfolioAccount"; accountId?: never; remaining: true; }; declare const PortfolioEquitySeriesSchema: v.SchemaWithPipe; readonly value: v.VariantSchema<"remaining", [v.ObjectSchema<{ readonly accountId: v.SchemaWithPipe, v.TransformAction]>; readonly remaining: v.LiteralSchema; }, undefined>, v.ObjectSchema<{ readonly accountId: v.OptionalSchema, undefined>; readonly remaining: v.LiteralSchema; }, undefined>], undefined>; }, undefined>; readonly equityQ: v.ArraySchema, undefined>; }, undefined>, v.TransformAction<{ grouping: { case: "portfolioAccount"; value: { accountId: string; remaining: false; } | { accountId?: undefined; remaining: true; }; }; equityQ: bigint[]; }, { grouping: PortfolioEquitySeriesGrouping; equity: string[]; }>]>; declare function createPortfolioEquityHistoryResponseSchema(scales: SdkScales): v.SchemaWithPipe, v.TransformAction]>; readonly bucket: v.StringSchema; readonly startTsSec: v.NumberSchema; readonly endTsSec: v.NumberSchema; readonly quoteAsset: v.StringSchema; readonly points: v.NumberSchema; readonly series: v.ArraySchema; readonly value: v.VariantSchema<"remaining", [v.ObjectSchema<{ readonly accountId: v.SchemaWithPipe, v.TransformAction]>; readonly remaining: v.LiteralSchema; }, undefined>, v.ObjectSchema<{ readonly accountId: v.OptionalSchema, undefined>; readonly remaining: v.LiteralSchema; }, undefined>], undefined>; }, undefined>; readonly equityQ: v.ArraySchema, undefined>; }, undefined>, v.TransformAction<{ grouping: { case: "portfolioAccount"; value: { accountId: string; remaining: false; } | { accountId?: undefined; remaining: true; }; }; equityQ: bigint[]; }, { grouping: PortfolioEquitySeriesGrouping; equity: string[]; }>]>, undefined>; readonly btcPricesQ: v.OptionalSchema, undefined>, readonly []>; }, undefined>, v.TransformAction<{ range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d"; bucket: string; startTsSec: number; endTsSec: number; quoteAsset: string; points: number; series: { grouping: PortfolioEquitySeriesGrouping; equity: string[]; }[]; btcPricesQ: bigint[]; }, { range: "unspecified" | "1d" | "7d" | "30d" | "90d" | "180d" | "365d"; bucket: string; startTsSec: number; endTsSec: number; quoteAsset: string; points: number; series: { grouping: PortfolioEquitySeriesGrouping; equity: string[]; }[]; btcPrices: string[]; }>]>; type PortfolioEquitySeries = v.InferOutput; type PortfolioEquityHistoryResponse = v.InferOutput>; declare function createPortfolioEquitySnapshotResponseSchema(scales: SdkScales): v.SchemaWithPipe; readonly totalEquityQ: v.BigintSchema; readonly accounts: v.ArraySchema, v.TransformAction]>; readonly equityQ: v.BigintSchema; readonly topAssetIds: v.ArraySchema, undefined>; }, undefined>, v.TransformAction<{ accountId: string; equityQ: bigint; topAssetIds: number[]; }, { accountId: string; equity: string; topAssetIds: number[]; }>]>, undefined>; readonly assets: v.ArraySchema; readonly balanceQ: v.BigintSchema; readonly equityQ: v.BigintSchema; }, undefined>, v.TransformAction<{ assetId: number; balanceQ: bigint; equityQ: bigint; }, { assetId: number; balance: string; equity: string; }>]>, undefined>; readonly btcPriceQ: v.BigintSchema; }, undefined>, v.TransformAction<{ quoteAsset: string; totalEquityQ: bigint; accounts: { accountId: string; equity: string; topAssetIds: number[]; }[]; assets: { assetId: number; balance: string; equity: string; }[]; btcPriceQ: bigint; }, { quoteAsset: string; totalEquity: string; accounts: { accountId: string; equity: string; topAssetIds: number[]; }[]; assets: { assetId: number; balance: string; equity: string; }[]; btcPrice: string; }>]>; type PortfolioEquitySnapshotResponse = v.InferOutput>; //#endregion export { BalanceHistoryInput, BalanceHistoryInputSchema, BalanceHistoryResponse, BalanceRange, BalanceRangeSchema, EquityGroupBy, EquityGroupBySchema, EquityHistoryInput, EquityHistoryInputSchema, EquityHistoryResponse, EquitySeries, EquitySeriesGrouping, EquitySeriesSchema, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryInputSchema, PortfolioEquityHistoryResponse, PortfolioEquitySeries, PortfolioEquitySeriesGrouping, PortfolioEquitySeriesSchema, PortfolioEquitySnapshotResponse, createBalanceHistoryResponseSchema, createEquityHistoryResponseSchema, createLedgerBalanceSchema, createPortfolioEquityHistoryResponseSchema, createPortfolioEquitySnapshotResponseSchema }; //# sourceMappingURL=balances.schemas.d.ts.map