@polyester/sdk 0.27.3 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/catalogs/readers.js +2 -2
- package/dist/catalogs/readers.js.map +1 -1
- package/dist/gen/auth/v1/policies_pb.d.ts +9 -6
- package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/policies_pb.js +7 -4
- package/dist/gen/auth/v1/policies_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_pb.d.ts +6 -6
- package/dist/gen/orders/v1/orders_pb.js +1 -1
- package/dist/gen/orders/v1/orders_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +4 -3
- package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.d.ts +14 -13
- package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.js +1 -1
- package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +42 -42
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/orders-batch.schemas.d.ts +28 -28
- package/dist/services/orders/orders-input.schemas.d.ts +36 -36
- package/dist/services/orders/orders-modify.schemas.d.ts +19 -19
- package/dist/services/orders/orders-output.schemas.d.ts +14 -14
- package/dist/services/orders/orders-output.schemas.js +1 -1
- package/dist/services/orders/orders-output.schemas.js.map +1 -1
- package/dist/services/orders/orders-risk.schemas.d.ts +11 -11
- package/dist/services/orders/orders-risk.schemas.js +9 -5
- package/dist/services/orders/orders-risk.schemas.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +2 -2
- package/dist/services/trailing-oneof-inputs.js +4 -9
- package/dist/services/trailing-oneof-inputs.js.map +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +3 -3
- package/dist/services/triggers/trigger-input.schemas.js +1 -1
- package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +21 -21
- package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.js +4 -4
- package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
- package/dist/shared/connect-error-mapping.d.ts.map +1 -1
- package/dist/shared/connect-error-mapping.js +7 -1
- package/dist/shared/connect-error-mapping.js.map +1 -1
- package/dist/shared/errors.d.ts +9 -3
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +12 -1
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/wire-bounds.js +1 -3
- package/dist/shared/wire-bounds.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @polyester/sdk
|
|
2
2
|
|
|
3
|
+
## 0.28.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Encode and decode absolute max-slippage ticks as int64 `bigint` values instead of int32 numbers. Absolute slippage inputs now accept values up to the int64 price ceiling, and `maxQuoteSlippage` on spot order constraints reports that ceiling instead of `2.147483647`. ([#173](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/173))
|
|
8
|
+
|
|
9
|
+
## 0.28.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Map HTTP 501 and Connect `unimplemented` to the new `NotImplementedError` instead of `InternalServerError`. Bare HTTP error responses without a Connect body now map by their status code instead of collapsing to `InternalServerError`. ([#171](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/171))
|
|
14
|
+
|
|
3
15
|
## 0.27.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/catalogs/readers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PROTOBUF_INT64_MAX } from "../shared/wire-bounds.js";
|
|
2
2
|
import { scaledToDecimal, scaledToDisplay, significantDecimalPlaces, tryDecimalToScaled, tryNormalizeDecimalInput, tryToScaledBigInt } from "./decimal.js";
|
|
3
3
|
import { CatalogConversionError, CatalogLookupError, CatalogValidationFailedError } from "./types.js";
|
|
4
4
|
import { indexesFor } from "./indexes.js";
|
|
@@ -321,7 +321,7 @@ var OrdersReader = class {
|
|
|
321
321
|
maxPrice: scaledToDecimal(PROTOBUF_INT64_MAX, priceScale),
|
|
322
322
|
maxQtyBase: scaledToDecimal(PROTOBUF_INT64_MAX, quantityScale),
|
|
323
323
|
maxNotionalQuote: scaledToDecimal(PROTOBUF_INT64_MAX, quoteAmountScale),
|
|
324
|
-
maxQuoteSlippage: scaledToDecimal(
|
|
324
|
+
maxQuoteSlippage: scaledToDecimal(PROTOBUF_INT64_MAX, priceScale),
|
|
325
325
|
priceScale,
|
|
326
326
|
quantityScale,
|
|
327
327
|
quoteAmountScale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readers.js","names":[],"sources":["../../src/catalogs/readers.ts"],"sourcesContent":["import type {\n AssetConfig,\n ZipperChainConfig,\n ZipperChainContractConfig,\n} from \"../shared/catalog-config.js\";\nimport {\n scaledToDecimal,\n scaledToDisplay,\n significantDecimalPlaces,\n tryDecimalToScaled,\n tryNormalizeDecimalInput,\n tryToScaledBigInt,\n type DecimalToScaledFailure,\n type ScaledIntegerLike,\n} from \"./decimal.js\";\nimport { indexesFor } from \"./indexes.js\";\nimport type { EnrichedPairConfig } from \"./market-data-catalog.js\";\nimport {\n resolveLedgerAssetByLedgerId,\n resolveZipperAssetByLedgerId,\n UNKNOWN_LEDGER_ASSET_ID,\n} from \"./unknown-asset.js\";\nimport type { ZipperContractName, ZipperEnrichedAssetConfig } from \"./zipper-catalog.js\";\nimport {\n CatalogConversionError,\n CatalogLookupError,\n CatalogValidationFailedError,\n type AssetCatalogKey,\n type CatalogLookupDomain,\n type CatalogReader,\n type CatalogSnapshot,\n type CatalogValidationError,\n type CatalogValidationResult,\n type ChainCatalogKey,\n type LedgerCatalogReader,\n type MarketCatalogReader,\n type OrdersCatalogReader,\n type PairCatalogKey,\n type ParsedCatalogAmount,\n type SpotOrderConstraints,\n type SpotOrderDecimalInput,\n type ZipperAssetChainRoute,\n type ZipperCatalogReader,\n} from \"./types.js\";\nimport { parseCatalogSnapshot } from \"./snapshot-validation.js\";\nimport { PROTOBUF_INT32_MAX, PROTOBUF_INT64_MAX } from \"../shared/wire-bounds.js\";\n\n/** Price ticks are always quoted at 9 decimal places. */\nexport const PRICE_SCALE = 9;\n\ntype SnapshotGetter = () => CatalogSnapshot;\n\nfunction isListed(pair: EnrichedPairConfig, nowMs: number): boolean {\n if (pair.listingAt === null || pair.listingAt > nowMs) return false;\n if (pair.status === \"disabled\") return false;\n if (pair.delistingAt !== null && pair.delistingAt < nowMs) return false;\n return true;\n}\n\nfunction isEverListed(pair: EnrichedPairConfig, nowMs: number): boolean {\n return pair.listingAt !== null && pair.listingAt < nowMs;\n}\n\nfunction requireFound<T>(\n domain: CatalogLookupDomain,\n lookup: string,\n value: string | number,\n found: T | null,\n): T {\n if (found === null) throw new CatalogLookupError(domain, lookup, value);\n return found;\n}\n\ntype ResolvedKey<TByName extends string, TById extends string> =\n | { lookup: TByName; value: string }\n | { lookup: TById; value: number };\n\nfunction resolvePairKey(key: PairCatalogKey): ResolvedKey<\"symbol\", \"symbolId\"> {\n if (typeof key === \"string\") return { lookup: \"symbol\", value: key };\n if (typeof key === \"number\") return { lookup: \"symbolId\", value: key };\n if (\"symbol\" in key) return { lookup: \"symbol\", value: key.symbol };\n return { lookup: \"symbolId\", value: key.symbolId };\n}\n\nfunction resolveAssetKey(key: AssetCatalogKey): ResolvedKey<\"symbol\", \"ledgerId\"> {\n if (typeof key === \"string\") return { lookup: \"symbol\", value: key };\n if (typeof key === \"number\") return { lookup: \"ledgerId\", value: key };\n if (\"symbol\" in key) return { lookup: \"symbol\", value: key.symbol };\n return { lookup: \"ledgerId\", value: key.ledgerId };\n}\n\nfunction resolveChainKey(key: ChainCatalogKey): ResolvedKey<\"chainCode\", \"chainId\"> {\n if (typeof key === \"string\") return { lookup: \"chainCode\", value: key };\n if (typeof key === \"number\") return { lookup: \"chainId\", value: key };\n if (\"code\" in key) return { lookup: \"chainCode\", value: key.code };\n return { lookup: \"chainId\", value: key.chainId };\n}\n\nfunction conversionFailureMessage(\n field: string,\n value: string,\n failure: DecimalToScaledFailure,\n): string {\n return failure.reason === \"precision\"\n ? `${field} supports at most ${failure.maxDecimals} decimal places: ${value}`\n : `${field} must be a non-negative decimal number: ${value}`;\n}\n\n/** Shared conversion core used by the market and ledger readers. */\nclass DecimalConverter {\n constructor(\n readonly field: string,\n readonly scale: number,\n readonly displayDecimals: number,\n ) {}\n\n parse(decimal: string): ParsedCatalogAmount {\n const result = tryDecimalToScaled(decimal, this.scale);\n if (!result.ok) {\n throw new CatalogConversionError(\n this.field,\n conversionFailureMessage(this.field, decimal, result.failure),\n );\n }\n return {\n scaledValue: result.scaled.toString(),\n decimal: scaledToDecimal(result.scaled, this.scale),\n display: scaledToDisplay(result.scaled, this.scale, this.displayDecimals),\n scale: this.scale,\n };\n }\n\n normalizeInput(raw: string): string {\n const normalized = tryNormalizeDecimalInput(raw, this.scale);\n if (normalized === null) {\n throw new CatalogConversionError(\n this.field,\n `${this.field} must be a non-negative decimal number: ${raw}`,\n );\n }\n return normalized;\n }\n\n toDecimalString(scaled: ScaledIntegerLike): string {\n return scaledToDecimal(this.toBigInt(scaled), this.scale);\n }\n\n toDisplayString(scaled: ScaledIntegerLike): string {\n return scaledToDisplay(this.toBigInt(scaled), this.scale, this.displayDecimals);\n }\n\n formatDecimal(decimal: string): string {\n const result = tryDecimalToScaled(decimal.trim(), this.scale);\n if (!result.ok) {\n throw new CatalogConversionError(\n this.field,\n conversionFailureMessage(this.field, decimal, result.failure),\n );\n }\n return scaledToDisplay(result.scaled, this.scale, this.displayDecimals);\n }\n\n private toBigInt(scaled: ScaledIntegerLike): bigint {\n const value = tryToScaledBigInt(scaled);\n if (value === null) {\n throw new CatalogConversionError(\n this.field,\n `${this.field} must be a raw scaled integer: ${String(scaled)}`,\n );\n }\n return value;\n }\n}\n\nfunction priceConverter(pair: EnrichedPairConfig): DecimalConverter {\n const tickDecimals = significantDecimalPlaces(pair.tickSize);\n const displayDecimals = tickDecimals > 0 ? tickDecimals : PRICE_SCALE;\n return new DecimalConverter(\"price\", PRICE_SCALE, displayDecimals);\n}\n\nfunction quantityConverter(pair: EnrichedPairConfig): DecimalConverter {\n return new DecimalConverter(\n \"quantity\",\n pair.baseAsset.quantityScale,\n pair.baseAsset.quantityDisplayDecimals,\n );\n}\n\nfunction quoteAmountConverter(pair: EnrichedPairConfig): DecimalConverter {\n return new DecimalConverter(\n \"quoteAmount\",\n pair.quoteAsset.quantityScale,\n pair.quoteAsset.quantityDisplayDecimals,\n );\n}\n\nfunction ledgerAmountConverter(asset: AssetConfig): DecimalConverter {\n return new DecimalConverter(\"amount\", asset.quantityScale, asset.quantityDisplayDecimals);\n}\n\nclass MarketReader implements MarketCatalogReader {\n constructor(private readonly getSnapshot: SnapshotGetter) {}\n\n listAssets(): readonly AssetConfig[] {\n return this.getSnapshot().market.assets;\n }\n\n getAsset(asset: AssetCatalogKey): AssetConfig | null {\n const key = resolveAssetKey(asset);\n return key.lookup === \"symbol\"\n ? this.getAssetBySymbol(key.value)\n : this.getAssetByLedgerId(key.value);\n }\n\n requireAsset(asset: AssetCatalogKey): AssetConfig {\n const key = resolveAssetKey(asset);\n return requireFound(\"market\", key.lookup, key.value, this.getAsset(asset));\n }\n\n getAssetBySymbol(assetSymbol: string): AssetConfig | null {\n return indexesFor(this.getSnapshot()).assetBySymbol.get(assetSymbol) ?? null;\n }\n\n requireAssetBySymbol(assetSymbol: string): AssetConfig {\n return requireFound(\"market\", \"symbol\", assetSymbol, this.getAssetBySymbol(assetSymbol));\n }\n\n getAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return resolveLedgerAssetByLedgerId(ledgerAssetId, (id) => this.lookupAssetByLedgerId(id));\n }\n\n lookupAssetByLedgerId(ledgerAssetId: number): AssetConfig | null {\n return indexesFor(this.getSnapshot()).assetByLedgerId.get(ledgerAssetId) ?? null;\n }\n\n requireAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return this.getAssetByLedgerId(ledgerAssetId);\n }\n\n listPairs(filter?: {\n listed?: boolean;\n everListed?: boolean;\n atMs?: number;\n }): readonly EnrichedPairConfig[] {\n const pairs = this.getSnapshot().market.pairs;\n if (!filter) return pairs;\n const nowMs = filter.atMs ?? Date.now();\n return pairs.filter((pair) => {\n if (filter.listed !== undefined && isListed(pair, nowMs) !== filter.listed)\n return false;\n if (filter.everListed !== undefined && isEverListed(pair, nowMs) !== filter.everListed)\n return false;\n return true;\n });\n }\n\n getPair(pair: PairCatalogKey): EnrichedPairConfig | null {\n const key = resolvePairKey(pair);\n return key.lookup === \"symbol\"\n ? this.getPairBySymbol(key.value)\n : this.getPairBySymbolId(key.value);\n }\n\n requirePair(pair: PairCatalogKey): EnrichedPairConfig {\n const key = resolvePairKey(pair);\n return requireFound(\"market\", key.lookup, key.value, this.getPair(pair));\n }\n\n getPairBySymbol(pairSymbol: string): EnrichedPairConfig | null {\n return indexesFor(this.getSnapshot()).pairBySymbol.get(pairSymbol) ?? null;\n }\n\n requirePairBySymbol(pairSymbol: string): EnrichedPairConfig {\n return requireFound(\"market\", \"symbol\", pairSymbol, this.getPairBySymbol(pairSymbol));\n }\n\n getPairBySymbolId(pairSymbolId: number): EnrichedPairConfig | null {\n return indexesFor(this.getSnapshot()).pairBySymbolId.get(pairSymbolId) ?? null;\n }\n\n requirePairBySymbolId(pairSymbolId: number): EnrichedPairConfig {\n return requireFound(\n \"market\",\n \"symbolId\",\n pairSymbolId,\n this.getPairBySymbolId(pairSymbolId),\n );\n }\n\n getSymbolIdByPairSymbol(pairSymbol: string): number | null {\n return this.getPairBySymbol(pairSymbol)?.symbolId ?? null;\n }\n\n requireSymbolIdByPairSymbol(pairSymbol: string): number {\n return this.requirePairBySymbol(pairSymbol).symbolId;\n }\n\n getPairSymbolBySymbolId(pairSymbolId: number): string | null {\n return this.getPairBySymbolId(pairSymbolId)?.symbol ?? null;\n }\n\n requirePairSymbolBySymbolId(pairSymbolId: number): string {\n return this.requirePairBySymbolId(pairSymbolId).symbol;\n }\n\n decimalPriceToTicks(price: string, pair: PairCatalogKey): ParsedCatalogAmount {\n return priceConverter(this.requirePair(pair)).parse(price);\n }\n\n normalizePriceInput(price: string, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).normalizeInput(price);\n }\n\n priceTicksToDecimalString(priceTicks: ScaledIntegerLike, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).toDecimalString(priceTicks);\n }\n\n priceTicksToDisplayString(priceTicks: ScaledIntegerLike, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).toDisplayString(priceTicks);\n }\n\n formatPrice(price: string, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).formatDecimal(price);\n }\n\n decimalQuantityToScaled(quantity: string, pair: PairCatalogKey): ParsedCatalogAmount {\n return quantityConverter(this.requirePair(pair)).parse(quantity);\n }\n\n normalizeQuantityInput(quantity: string, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).normalizeInput(quantity);\n }\n\n quantityScaledToDecimalString(quantityScaled: ScaledIntegerLike, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).toDecimalString(quantityScaled);\n }\n\n quantityScaledToDisplayString(quantityScaled: ScaledIntegerLike, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).toDisplayString(quantityScaled);\n }\n\n formatQuantity(quantity: string, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).formatDecimal(quantity);\n }\n\n decimalQuoteAmountToScaled(amount: string, pair: PairCatalogKey): ParsedCatalogAmount {\n return quoteAmountConverter(this.requirePair(pair)).parse(amount);\n }\n\n normalizeQuoteAmountInput(amount: string, pair: PairCatalogKey): string {\n return quoteAmountConverter(this.requirePair(pair)).normalizeInput(amount);\n }\n\n quoteAmountScaledToDecimalString(\n amountScaled: ScaledIntegerLike,\n pair: PairCatalogKey,\n ): string {\n return quoteAmountConverter(this.requirePair(pair)).toDecimalString(amountScaled);\n }\n\n quoteAmountScaledToDisplayString(\n amountScaled: ScaledIntegerLike,\n pair: PairCatalogKey,\n ): string {\n return quoteAmountConverter(this.requirePair(pair)).toDisplayString(amountScaled);\n }\n\n formatQuoteAmount(amount: string, pair: PairCatalogKey): string {\n return quoteAmountConverter(this.requirePair(pair)).formatDecimal(amount);\n }\n}\n\nclass LedgerReader implements LedgerCatalogReader {\n constructor(private readonly market: MarketReader) {}\n\n getAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return this.market.getAssetByLedgerId(ledgerAssetId);\n }\n\n requireAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return this.getAssetByLedgerId(ledgerAssetId);\n }\n\n getAssetBySymbol(assetSymbol: string): AssetConfig | null {\n return this.market.getAssetBySymbol(assetSymbol);\n }\n\n requireAssetBySymbol(assetSymbol: string): AssetConfig {\n return requireFound(\"ledger\", \"symbol\", assetSymbol, this.getAssetBySymbol(assetSymbol));\n }\n\n getLedgerIdBySymbol(assetSymbol: string): number | null {\n return this.getAssetBySymbol(assetSymbol)?.ledgerId ?? null;\n }\n\n requireLedgerIdBySymbol(assetSymbol: string): number {\n return this.requireAssetBySymbol(assetSymbol).ledgerId;\n }\n\n requireSymbolByLedgerId(ledgerAssetId: number): string {\n return this.requireAssetByLedgerId(ledgerAssetId).symbol;\n }\n\n isKnownAssetId(ledgerAssetId: number): boolean {\n if (!Number.isInteger(ledgerAssetId) || ledgerAssetId <= 0) return false;\n if (ledgerAssetId === UNKNOWN_LEDGER_ASSET_ID) return false;\n return this.market.lookupAssetByLedgerId(ledgerAssetId) !== null;\n }\n\n decimalAmountToScaled(amount: string, asset: AssetCatalogKey): ParsedCatalogAmount {\n return ledgerAmountConverter(this.requireAsset(asset)).parse(amount);\n }\n\n normalizeAmountInput(amount: string, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).normalizeInput(amount);\n }\n\n amountScaledToDecimalString(amountScaled: ScaledIntegerLike, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).toDecimalString(amountScaled);\n }\n\n amountScaledToDisplayString(amountScaled: ScaledIntegerLike, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).toDisplayString(amountScaled);\n }\n\n formatAmount(amount: string, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).formatDecimal(amount);\n }\n\n private requireAsset(asset: AssetCatalogKey): AssetConfig {\n const key = resolveAssetKey(asset);\n const found =\n key.lookup === \"symbol\"\n ? this.getAssetBySymbol(key.value)\n : this.getAssetByLedgerId(key.value);\n return requireFound(\"ledger\", key.lookup, key.value, found);\n }\n}\n\nclass OrdersReader implements OrdersCatalogReader {\n constructor(private readonly market: MarketReader) {}\n\n getSpotOrderConstraints(pair: PairCatalogKey): SpotOrderConstraints {\n const config = this.market.requirePair(pair);\n const priceScale = PRICE_SCALE;\n const quantityScale = config.baseAsset.quantityScale;\n const quoteAmountScale = config.quoteAsset.quantityScale;\n return {\n symbolId: config.symbolId,\n symbol: config.symbol,\n status: config.status,\n tickSize: config.tickSize,\n stepSize: config.stepSize,\n minQtyBase: config.minQtyBase,\n minNotionalQuote: config.minNotionalQuote,\n maxPrice: scaledToDecimal(PROTOBUF_INT64_MAX, priceScale),\n maxQtyBase: scaledToDecimal(PROTOBUF_INT64_MAX, quantityScale),\n maxNotionalQuote: scaledToDecimal(PROTOBUF_INT64_MAX, quoteAmountScale),\n maxQuoteSlippage: scaledToDecimal(PROTOBUF_INT32_MAX, priceScale),\n priceScale,\n quantityScale,\n quoteAmountScale,\n priceDisplayDecimals: priceConverter(config).displayDecimals,\n quantityDisplayDecimals: config.baseAsset.quantityDisplayDecimals,\n quoteAmountDisplayDecimals: config.quoteAsset.quantityDisplayDecimals,\n };\n }\n\n validateSpotOrderDecimalInput(input: SpotOrderDecimalInput): CatalogValidationResult {\n const pair = this.market.requirePair(input.pair);\n const errors: CatalogValidationError[] = [];\n\n const quantityScaled = this.validateQuantity(pair, input.quantity, errors);\n const priceTicks =\n input.price === undefined ? null : this.validatePrice(pair, input.price, errors);\n\n if (quantityScaled !== null && priceTicks !== null) {\n this.validateMinNotional(pair, quantityScaled, priceTicks, errors);\n }\n\n return { valid: errors.length === 0, errors };\n }\n\n assertSpotOrderDecimalInput(input: SpotOrderDecimalInput): void {\n const result = this.validateSpotOrderDecimalInput(input);\n if (!result.valid) throw new CatalogValidationFailedError(result.errors);\n }\n\n private validateQuantity(\n pair: EnrichedPairConfig,\n quantity: string,\n errors: CatalogValidationError[],\n ): bigint | null {\n const scale = pair.baseAsset.quantityScale;\n const parsed = tryDecimalToScaled(quantity, scale);\n if (!parsed.ok) {\n errors.push({\n field: \"quantity\",\n rule: \"parse\",\n message: conversionFailureMessage(\"quantity\", quantity, parsed.failure),\n actual: quantity,\n });\n return null;\n }\n\n if (parsed.scaled > PROTOBUF_INT64_MAX) {\n const maximum = scaledToDecimal(PROTOBUF_INT64_MAX, scale);\n errors.push({\n field: \"quantity\",\n rule: \"maxQty\",\n message: `quantity exceeds the wire-format maximum of ${maximum}`,\n expected: maximum,\n actual: quantity,\n });\n return null;\n }\n\n const step = this.requireConstraintScaled(pair.stepSize, scale, \"stepSize\");\n if (step > 0n && parsed.scaled % step !== 0n) {\n errors.push({\n field: \"quantity\",\n rule: \"stepSize\",\n message: `quantity must be a multiple of the pair step size ${pair.stepSize}`,\n expected: pair.stepSize,\n actual: quantity,\n });\n }\n\n const minQty = this.requireConstraintScaled(pair.minQtyBase, scale, \"minQtyBase\");\n if (parsed.scaled < minQty || parsed.scaled === 0n) {\n errors.push({\n field: \"quantity\",\n rule: \"minQty\",\n message: `quantity is below the pair minimum of ${pair.minQtyBase}`,\n expected: pair.minQtyBase,\n actual: quantity,\n });\n }\n\n return parsed.scaled;\n }\n\n private validatePrice(\n pair: EnrichedPairConfig,\n price: string,\n errors: CatalogValidationError[],\n ): bigint | null {\n const parsed = tryDecimalToScaled(price, PRICE_SCALE);\n if (!parsed.ok) {\n errors.push({\n field: \"price\",\n rule: \"parse\",\n message: conversionFailureMessage(\"price\", price, parsed.failure),\n actual: price,\n });\n return null;\n }\n\n if (parsed.scaled > PROTOBUF_INT64_MAX) {\n const maximum = scaledToDecimal(PROTOBUF_INT64_MAX, PRICE_SCALE);\n errors.push({\n field: \"price\",\n rule: \"maxPrice\",\n message: `price exceeds the wire-format maximum of ${maximum}`,\n expected: maximum,\n actual: price,\n });\n return null;\n }\n\n const tick = this.requireConstraintScaled(pair.tickSize, PRICE_SCALE, \"tickSize\");\n if (tick > 0n && parsed.scaled % tick !== 0n) {\n errors.push({\n field: \"price\",\n rule: \"tickSize\",\n message: `price must be a multiple of the pair tick size ${pair.tickSize}`,\n expected: pair.tickSize,\n actual: price,\n });\n }\n\n return parsed.scaled;\n }\n\n private validateMinNotional(\n pair: EnrichedPairConfig,\n quantityScaled: bigint,\n priceTicks: bigint,\n errors: CatalogValidationError[],\n ): void {\n const notionalScale = pair.baseAsset.quantityScale + PRICE_SCALE;\n const minNotional = this.requireConstraintScaled(\n pair.minNotionalQuote,\n notionalScale,\n \"minNotionalQuote\",\n );\n const notional = quantityScaled * priceTicks;\n if (notional < minNotional) {\n errors.push({\n field: \"notional\",\n rule: \"minNotional\",\n message: `order notional is below the pair minimum of ${pair.minNotionalQuote}`,\n expected: pair.minNotionalQuote,\n actual: scaledToDecimal(notional, notionalScale),\n });\n }\n }\n\n /** Pair constraint strings come from the catalog itself, so failures are data bugs. */\n private requireConstraintScaled(decimal: string, scale: number, field: string): bigint {\n const result = tryDecimalToScaled(decimal, scale);\n if (!result.ok) {\n throw new CatalogConversionError(\n field,\n conversionFailureMessage(field, decimal, result.failure),\n );\n }\n return result.scaled;\n }\n}\n\nclass ZipperReader implements ZipperCatalogReader {\n constructor(private readonly getSnapshot: SnapshotGetter) {}\n\n listChains(): readonly ZipperChainConfig[] {\n return this.getSnapshot().zipper.chains;\n }\n\n getChain(chain: ChainCatalogKey): ZipperChainConfig | null {\n const key = resolveChainKey(chain);\n return key.lookup === \"chainCode\"\n ? this.getChainByCode(key.value)\n : this.getChainById(key.value);\n }\n\n requireChain(chain: ChainCatalogKey): ZipperChainConfig {\n const key = resolveChainKey(chain);\n return requireFound(\"zipper\", key.lookup, key.value, this.getChain(chain));\n }\n\n getChainByCode(chainCode: string): ZipperChainConfig | null {\n return indexesFor(this.getSnapshot()).zipperChainByCode.get(chainCode) ?? null;\n }\n\n requireChainByCode(chainCode: string): ZipperChainConfig {\n return requireFound(\"zipper\", \"chainCode\", chainCode, this.getChainByCode(chainCode));\n }\n\n getChainById(chainId: number): ZipperChainConfig | null {\n return indexesFor(this.getSnapshot()).zipperChainById.get(chainId) ?? null;\n }\n\n requireChainById(chainId: number): ZipperChainConfig {\n return requireFound(\"zipper\", \"chainId\", chainId, this.getChainById(chainId));\n }\n\n getChainIdByCode(chainCode: string): number | null {\n return this.getChainByCode(chainCode)?.chainId ?? null;\n }\n\n requireChainIdByCode(chainCode: string): number {\n return this.requireChainByCode(chainCode).chainId;\n }\n\n listAssets(): readonly ZipperEnrichedAssetConfig[] {\n return this.getSnapshot().zipper.assets;\n }\n\n getAsset(asset: AssetCatalogKey): ZipperEnrichedAssetConfig | null {\n const key = resolveAssetKey(asset);\n return key.lookup === \"symbol\"\n ? this.getAssetBySymbol(key.value)\n : this.getAssetByLedgerId(key.value);\n }\n\n requireAsset(asset: AssetCatalogKey): ZipperEnrichedAssetConfig {\n const key = resolveAssetKey(asset);\n return requireFound(\"zipper\", key.lookup, key.value, this.getAsset(asset));\n }\n\n getAssetBySymbol(assetSymbol: string): ZipperEnrichedAssetConfig | null {\n return indexesFor(this.getSnapshot()).zipperAssetBySymbol.get(assetSymbol) ?? null;\n }\n\n requireAssetBySymbol(assetSymbol: string): ZipperEnrichedAssetConfig {\n return requireFound(\"zipper\", \"symbol\", assetSymbol, this.getAssetBySymbol(assetSymbol));\n }\n\n getAssetByLedgerId(ledgerAssetId: number): ZipperEnrichedAssetConfig {\n return resolveZipperAssetByLedgerId(ledgerAssetId, (id) => this.lookupAssetByLedgerId(id));\n }\n\n lookupAssetByLedgerId(ledgerAssetId: number): ZipperEnrichedAssetConfig | null {\n return indexesFor(this.getSnapshot()).zipperAssetByLedgerId.get(ledgerAssetId) ?? null;\n }\n\n requireAssetByLedgerId(ledgerAssetId: number): ZipperEnrichedAssetConfig {\n return this.getAssetByLedgerId(ledgerAssetId);\n }\n\n getAssetByUAssetId(uAssetId: string): ZipperEnrichedAssetConfig | null {\n return indexesFor(this.getSnapshot()).zipperAssetByUAssetId.get(uAssetId) ?? null;\n }\n\n requireAssetByUAssetId(uAssetId: string): ZipperEnrichedAssetConfig {\n return requireFound(\"zipper\", \"uAssetId\", uAssetId, this.getAssetByUAssetId(uAssetId));\n }\n\n getAssetChain(asset: AssetCatalogKey, chain: ChainCatalogKey): ZipperAssetChainRoute | null {\n const zipperAsset = this.getAsset(asset);\n const zipperChain = this.getChain(chain);\n if (!zipperAsset || !zipperChain) return null;\n const route = zipperAsset.chains.find(\n (candidate) => candidate.chainId === zipperChain.chainId,\n );\n return route ? { asset: zipperAsset, chain: route } : null;\n }\n\n requireAssetChain(asset: AssetCatalogKey, chain: ChainCatalogKey): ZipperAssetChainRoute {\n const route = this.getAssetChain(asset, chain);\n if (!route) {\n throw new CatalogLookupError(\n \"zipper\",\n \"assetChain\",\n `${formatKey(resolveAssetKey(asset))}:${formatKey(resolveChainKey(chain))}`,\n );\n }\n return route;\n }\n\n getAssetChainByZippedAssetId(zippedAssetId: number): ZipperAssetChainRoute | null {\n return indexesFor(this.getSnapshot()).zipperRouteByZippedAssetId.get(zippedAssetId) ?? null;\n }\n\n requireAssetChainByZippedAssetId(zippedAssetId: number): ZipperAssetChainRoute {\n return requireFound(\n \"zipper\",\n \"zippedAssetId\",\n zippedAssetId,\n this.getAssetChainByZippedAssetId(zippedAssetId),\n );\n }\n\n getZippedAssetId(asset: AssetCatalogKey, chain: ChainCatalogKey): number | null {\n return this.getAssetChain(asset, chain)?.chain.zippedAssetId ?? null;\n }\n\n requireZippedAssetId(asset: AssetCatalogKey, chain: ChainCatalogKey): number {\n return this.requireAssetChain(asset, chain).chain.zippedAssetId;\n }\n\n listContracts(): readonly ZipperChainContractConfig[] {\n return this.getSnapshot().zipper.contracts;\n }\n\n getContract(contractName: ZipperContractName): ZipperChainContractConfig | null {\n return this.getContractByName(contractName);\n }\n\n requireContract(contractName: ZipperContractName): ZipperChainContractConfig {\n return this.requireContractByName(contractName);\n }\n\n getContractByName(contractName: ZipperContractName): ZipperChainContractConfig | null {\n return indexesFor(this.getSnapshot()).zipperContractByName.get(contractName) ?? null;\n }\n\n requireContractByName(contractName: ZipperContractName): ZipperChainContractConfig {\n return requireFound(\n \"zipper\",\n \"contractName\",\n contractName,\n this.getContractByName(contractName),\n );\n }\n}\n\nfunction formatKey(key: { lookup: string; value: string | number }): string {\n return String(key.value);\n}\n\nclass SnapshotCatalogReader implements CatalogReader {\n readonly market: MarketCatalogReader;\n readonly ledger: LedgerCatalogReader;\n readonly orders: OrdersCatalogReader;\n readonly zipper: ZipperCatalogReader;\n readonly snapshot: () => CatalogSnapshot;\n\n constructor(getSnapshot: SnapshotGetter) {\n const market = new MarketReader(getSnapshot);\n this.market = market;\n this.ledger = new LedgerReader(market);\n this.orders = new OrdersReader(market);\n this.zipper = new ZipperReader(getSnapshot);\n this.snapshot = () => getSnapshot();\n }\n}\n\nexport function createReader(getSnapshot: () => CatalogSnapshot): CatalogReader {\n return new SnapshotCatalogReader(getSnapshot);\n}\n\nexport function createCatalogSnapshotReader(snapshot: CatalogSnapshot): CatalogReader {\n const parsed = parseCatalogSnapshot(snapshot);\n return createReader(() => parsed);\n}\n"],"mappings":";;;;;;AAoDA,SAAS,SAAS,MAA0B,OAAwB;CAChE,IAAI,KAAK,cAAc,QAAQ,KAAK,YAAY,OAAO,OAAO;CAC9D,IAAI,KAAK,WAAW,YAAY,OAAO;CACvC,IAAI,KAAK,gBAAgB,QAAQ,KAAK,cAAc,OAAO,OAAO;CAClE,OAAO;AACX;AAEA,SAAS,aAAa,MAA0B,OAAwB;CACpE,OAAO,KAAK,cAAc,QAAQ,KAAK,YAAY;AACvD;AAEA,SAAS,aACL,QACA,QACA,OACA,OACC;CACD,IAAI,UAAU,MAAM,MAAM,IAAI,mBAAmB,QAAQ,QAAQ,KAAK;CACtE,OAAO;AACX;AAMA,SAAS,eAAe,KAAwD;CAC5E,IAAI,OAAO,QAAQ,UAAU,OAAO;EAAE,QAAQ;EAAU,OAAO;CAAI;CACnE,IAAI,OAAO,QAAQ,UAAU,OAAO;EAAE,QAAQ;EAAY,OAAO;CAAI;CACrE,IAAI,YAAY,KAAK,OAAO;EAAE,QAAQ;EAAU,OAAO,IAAI;CAAO;CAClE,OAAO;EAAE,QAAQ;EAAY,OAAO,IAAI;CAAS;AACrD;AAEA,SAAS,gBAAgB,KAAyD;CAC9E,IAAI,OAAO,QAAQ,UAAU,OAAO;EAAE,QAAQ;EAAU,OAAO;CAAI;CACnE,IAAI,OAAO,QAAQ,UAAU,OAAO;EAAE,QAAQ;EAAY,OAAO;CAAI;CACrE,IAAI,YAAY,KAAK,OAAO;EAAE,QAAQ;EAAU,OAAO,IAAI;CAAO;CAClE,OAAO;EAAE,QAAQ;EAAY,OAAO,IAAI;CAAS;AACrD;AAEA,SAAS,gBAAgB,KAA2D;CAChF,IAAI,OAAO,QAAQ,UAAU,OAAO;EAAE,QAAQ;EAAa,OAAO;CAAI;CACtE,IAAI,O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ACvC;CACJ;AACJ;AAEA,SAAS,UAAU,KAAyD;CACxE,OAAO,OAAO,IAAI,KAAK;AAC3B;AAEA,IAAM,wBAAN,MAAqD;CACjD;CACA;CACA;CACA;CACA;CAEA,YAAY,aAA6B;EACrC,MAAM,SAAS,IAAI,aAAa,WAAW;EAC3C,KAAK,SAAS;EACd,KAAK,SAAS,IAAI,aAAa,MAAM;EACrC,KAAK,SAAS,IAAI,aAAa,MAAM;EACrC,KAAK,SAAS,IAAI,aAAa,WAAW;EAC1C,KAAK,iBAAiB,YAAY;CACtC;AACJ;AAEA,SAAgB,aAAa,aAAmD;CAC5E,OAAO,IAAI,sBAAsB,WAAW;AAChD;AAEA,SAAgB,4BAA4B,UAA0C;CAClF,MAAM,SAAS,qBAAqB,QAAQ;CAC5C,OAAO,mBAAmB,MAAM;AACpC"}
|
|
1
|
+
{"version":3,"file":"readers.js","names":[],"sources":["../../src/catalogs/readers.ts"],"sourcesContent":["import type {\n AssetConfig,\n ZipperChainConfig,\n ZipperChainContractConfig,\n} from \"../shared/catalog-config.js\";\nimport {\n scaledToDecimal,\n scaledToDisplay,\n significantDecimalPlaces,\n tryDecimalToScaled,\n tryNormalizeDecimalInput,\n tryToScaledBigInt,\n type DecimalToScaledFailure,\n type ScaledIntegerLike,\n} from \"./decimal.js\";\nimport { indexesFor } from \"./indexes.js\";\nimport type { EnrichedPairConfig } from \"./market-data-catalog.js\";\nimport {\n resolveLedgerAssetByLedgerId,\n resolveZipperAssetByLedgerId,\n UNKNOWN_LEDGER_ASSET_ID,\n} from \"./unknown-asset.js\";\nimport type { ZipperContractName, ZipperEnrichedAssetConfig } from \"./zipper-catalog.js\";\nimport {\n CatalogConversionError,\n CatalogLookupError,\n CatalogValidationFailedError,\n type AssetCatalogKey,\n type CatalogLookupDomain,\n type CatalogReader,\n type CatalogSnapshot,\n type CatalogValidationError,\n type CatalogValidationResult,\n type ChainCatalogKey,\n type LedgerCatalogReader,\n type MarketCatalogReader,\n type OrdersCatalogReader,\n type PairCatalogKey,\n type ParsedCatalogAmount,\n type SpotOrderConstraints,\n type SpotOrderDecimalInput,\n type ZipperAssetChainRoute,\n type ZipperCatalogReader,\n} from \"./types.js\";\nimport { parseCatalogSnapshot } from \"./snapshot-validation.js\";\nimport { PROTOBUF_INT64_MAX } from \"../shared/wire-bounds.js\";\n\n/** Price ticks are always quoted at 9 decimal places. */\nexport const PRICE_SCALE = 9;\n\ntype SnapshotGetter = () => CatalogSnapshot;\n\nfunction isListed(pair: EnrichedPairConfig, nowMs: number): boolean {\n if (pair.listingAt === null || pair.listingAt > nowMs) return false;\n if (pair.status === \"disabled\") return false;\n if (pair.delistingAt !== null && pair.delistingAt < nowMs) return false;\n return true;\n}\n\nfunction isEverListed(pair: EnrichedPairConfig, nowMs: number): boolean {\n return pair.listingAt !== null && pair.listingAt < nowMs;\n}\n\nfunction requireFound<T>(\n domain: CatalogLookupDomain,\n lookup: string,\n value: string | number,\n found: T | null,\n): T {\n if (found === null) throw new CatalogLookupError(domain, lookup, value);\n return found;\n}\n\ntype ResolvedKey<TByName extends string, TById extends string> =\n | { lookup: TByName; value: string }\n | { lookup: TById; value: number };\n\nfunction resolvePairKey(key: PairCatalogKey): ResolvedKey<\"symbol\", \"symbolId\"> {\n if (typeof key === \"string\") return { lookup: \"symbol\", value: key };\n if (typeof key === \"number\") return { lookup: \"symbolId\", value: key };\n if (\"symbol\" in key) return { lookup: \"symbol\", value: key.symbol };\n return { lookup: \"symbolId\", value: key.symbolId };\n}\n\nfunction resolveAssetKey(key: AssetCatalogKey): ResolvedKey<\"symbol\", \"ledgerId\"> {\n if (typeof key === \"string\") return { lookup: \"symbol\", value: key };\n if (typeof key === \"number\") return { lookup: \"ledgerId\", value: key };\n if (\"symbol\" in key) return { lookup: \"symbol\", value: key.symbol };\n return { lookup: \"ledgerId\", value: key.ledgerId };\n}\n\nfunction resolveChainKey(key: ChainCatalogKey): ResolvedKey<\"chainCode\", \"chainId\"> {\n if (typeof key === \"string\") return { lookup: \"chainCode\", value: key };\n if (typeof key === \"number\") return { lookup: \"chainId\", value: key };\n if (\"code\" in key) return { lookup: \"chainCode\", value: key.code };\n return { lookup: \"chainId\", value: key.chainId };\n}\n\nfunction conversionFailureMessage(\n field: string,\n value: string,\n failure: DecimalToScaledFailure,\n): string {\n return failure.reason === \"precision\"\n ? `${field} supports at most ${failure.maxDecimals} decimal places: ${value}`\n : `${field} must be a non-negative decimal number: ${value}`;\n}\n\n/** Shared conversion core used by the market and ledger readers. */\nclass DecimalConverter {\n constructor(\n readonly field: string,\n readonly scale: number,\n readonly displayDecimals: number,\n ) {}\n\n parse(decimal: string): ParsedCatalogAmount {\n const result = tryDecimalToScaled(decimal, this.scale);\n if (!result.ok) {\n throw new CatalogConversionError(\n this.field,\n conversionFailureMessage(this.field, decimal, result.failure),\n );\n }\n return {\n scaledValue: result.scaled.toString(),\n decimal: scaledToDecimal(result.scaled, this.scale),\n display: scaledToDisplay(result.scaled, this.scale, this.displayDecimals),\n scale: this.scale,\n };\n }\n\n normalizeInput(raw: string): string {\n const normalized = tryNormalizeDecimalInput(raw, this.scale);\n if (normalized === null) {\n throw new CatalogConversionError(\n this.field,\n `${this.field} must be a non-negative decimal number: ${raw}`,\n );\n }\n return normalized;\n }\n\n toDecimalString(scaled: ScaledIntegerLike): string {\n return scaledToDecimal(this.toBigInt(scaled), this.scale);\n }\n\n toDisplayString(scaled: ScaledIntegerLike): string {\n return scaledToDisplay(this.toBigInt(scaled), this.scale, this.displayDecimals);\n }\n\n formatDecimal(decimal: string): string {\n const result = tryDecimalToScaled(decimal.trim(), this.scale);\n if (!result.ok) {\n throw new CatalogConversionError(\n this.field,\n conversionFailureMessage(this.field, decimal, result.failure),\n );\n }\n return scaledToDisplay(result.scaled, this.scale, this.displayDecimals);\n }\n\n private toBigInt(scaled: ScaledIntegerLike): bigint {\n const value = tryToScaledBigInt(scaled);\n if (value === null) {\n throw new CatalogConversionError(\n this.field,\n `${this.field} must be a raw scaled integer: ${String(scaled)}`,\n );\n }\n return value;\n }\n}\n\nfunction priceConverter(pair: EnrichedPairConfig): DecimalConverter {\n const tickDecimals = significantDecimalPlaces(pair.tickSize);\n const displayDecimals = tickDecimals > 0 ? tickDecimals : PRICE_SCALE;\n return new DecimalConverter(\"price\", PRICE_SCALE, displayDecimals);\n}\n\nfunction quantityConverter(pair: EnrichedPairConfig): DecimalConverter {\n return new DecimalConverter(\n \"quantity\",\n pair.baseAsset.quantityScale,\n pair.baseAsset.quantityDisplayDecimals,\n );\n}\n\nfunction quoteAmountConverter(pair: EnrichedPairConfig): DecimalConverter {\n return new DecimalConverter(\n \"quoteAmount\",\n pair.quoteAsset.quantityScale,\n pair.quoteAsset.quantityDisplayDecimals,\n );\n}\n\nfunction ledgerAmountConverter(asset: AssetConfig): DecimalConverter {\n return new DecimalConverter(\"amount\", asset.quantityScale, asset.quantityDisplayDecimals);\n}\n\nclass MarketReader implements MarketCatalogReader {\n constructor(private readonly getSnapshot: SnapshotGetter) {}\n\n listAssets(): readonly AssetConfig[] {\n return this.getSnapshot().market.assets;\n }\n\n getAsset(asset: AssetCatalogKey): AssetConfig | null {\n const key = resolveAssetKey(asset);\n return key.lookup === \"symbol\"\n ? this.getAssetBySymbol(key.value)\n : this.getAssetByLedgerId(key.value);\n }\n\n requireAsset(asset: AssetCatalogKey): AssetConfig {\n const key = resolveAssetKey(asset);\n return requireFound(\"market\", key.lookup, key.value, this.getAsset(asset));\n }\n\n getAssetBySymbol(assetSymbol: string): AssetConfig | null {\n return indexesFor(this.getSnapshot()).assetBySymbol.get(assetSymbol) ?? null;\n }\n\n requireAssetBySymbol(assetSymbol: string): AssetConfig {\n return requireFound(\"market\", \"symbol\", assetSymbol, this.getAssetBySymbol(assetSymbol));\n }\n\n getAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return resolveLedgerAssetByLedgerId(ledgerAssetId, (id) => this.lookupAssetByLedgerId(id));\n }\n\n lookupAssetByLedgerId(ledgerAssetId: number): AssetConfig | null {\n return indexesFor(this.getSnapshot()).assetByLedgerId.get(ledgerAssetId) ?? null;\n }\n\n requireAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return this.getAssetByLedgerId(ledgerAssetId);\n }\n\n listPairs(filter?: {\n listed?: boolean;\n everListed?: boolean;\n atMs?: number;\n }): readonly EnrichedPairConfig[] {\n const pairs = this.getSnapshot().market.pairs;\n if (!filter) return pairs;\n const nowMs = filter.atMs ?? Date.now();\n return pairs.filter((pair) => {\n if (filter.listed !== undefined && isListed(pair, nowMs) !== filter.listed)\n return false;\n if (filter.everListed !== undefined && isEverListed(pair, nowMs) !== filter.everListed)\n return false;\n return true;\n });\n }\n\n getPair(pair: PairCatalogKey): EnrichedPairConfig | null {\n const key = resolvePairKey(pair);\n return key.lookup === \"symbol\"\n ? this.getPairBySymbol(key.value)\n : this.getPairBySymbolId(key.value);\n }\n\n requirePair(pair: PairCatalogKey): EnrichedPairConfig {\n const key = resolvePairKey(pair);\n return requireFound(\"market\", key.lookup, key.value, this.getPair(pair));\n }\n\n getPairBySymbol(pairSymbol: string): EnrichedPairConfig | null {\n return indexesFor(this.getSnapshot()).pairBySymbol.get(pairSymbol) ?? null;\n }\n\n requirePairBySymbol(pairSymbol: string): EnrichedPairConfig {\n return requireFound(\"market\", \"symbol\", pairSymbol, this.getPairBySymbol(pairSymbol));\n }\n\n getPairBySymbolId(pairSymbolId: number): EnrichedPairConfig | null {\n return indexesFor(this.getSnapshot()).pairBySymbolId.get(pairSymbolId) ?? null;\n }\n\n requirePairBySymbolId(pairSymbolId: number): EnrichedPairConfig {\n return requireFound(\n \"market\",\n \"symbolId\",\n pairSymbolId,\n this.getPairBySymbolId(pairSymbolId),\n );\n }\n\n getSymbolIdByPairSymbol(pairSymbol: string): number | null {\n return this.getPairBySymbol(pairSymbol)?.symbolId ?? null;\n }\n\n requireSymbolIdByPairSymbol(pairSymbol: string): number {\n return this.requirePairBySymbol(pairSymbol).symbolId;\n }\n\n getPairSymbolBySymbolId(pairSymbolId: number): string | null {\n return this.getPairBySymbolId(pairSymbolId)?.symbol ?? null;\n }\n\n requirePairSymbolBySymbolId(pairSymbolId: number): string {\n return this.requirePairBySymbolId(pairSymbolId).symbol;\n }\n\n decimalPriceToTicks(price: string, pair: PairCatalogKey): ParsedCatalogAmount {\n return priceConverter(this.requirePair(pair)).parse(price);\n }\n\n normalizePriceInput(price: string, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).normalizeInput(price);\n }\n\n priceTicksToDecimalString(priceTicks: ScaledIntegerLike, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).toDecimalString(priceTicks);\n }\n\n priceTicksToDisplayString(priceTicks: ScaledIntegerLike, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).toDisplayString(priceTicks);\n }\n\n formatPrice(price: string, pair: PairCatalogKey): string {\n return priceConverter(this.requirePair(pair)).formatDecimal(price);\n }\n\n decimalQuantityToScaled(quantity: string, pair: PairCatalogKey): ParsedCatalogAmount {\n return quantityConverter(this.requirePair(pair)).parse(quantity);\n }\n\n normalizeQuantityInput(quantity: string, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).normalizeInput(quantity);\n }\n\n quantityScaledToDecimalString(quantityScaled: ScaledIntegerLike, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).toDecimalString(quantityScaled);\n }\n\n quantityScaledToDisplayString(quantityScaled: ScaledIntegerLike, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).toDisplayString(quantityScaled);\n }\n\n formatQuantity(quantity: string, pair: PairCatalogKey): string {\n return quantityConverter(this.requirePair(pair)).formatDecimal(quantity);\n }\n\n decimalQuoteAmountToScaled(amount: string, pair: PairCatalogKey): ParsedCatalogAmount {\n return quoteAmountConverter(this.requirePair(pair)).parse(amount);\n }\n\n normalizeQuoteAmountInput(amount: string, pair: PairCatalogKey): string {\n return quoteAmountConverter(this.requirePair(pair)).normalizeInput(amount);\n }\n\n quoteAmountScaledToDecimalString(\n amountScaled: ScaledIntegerLike,\n pair: PairCatalogKey,\n ): string {\n return quoteAmountConverter(this.requirePair(pair)).toDecimalString(amountScaled);\n }\n\n quoteAmountScaledToDisplayString(\n amountScaled: ScaledIntegerLike,\n pair: PairCatalogKey,\n ): string {\n return quoteAmountConverter(this.requirePair(pair)).toDisplayString(amountScaled);\n }\n\n formatQuoteAmount(amount: string, pair: PairCatalogKey): string {\n return quoteAmountConverter(this.requirePair(pair)).formatDecimal(amount);\n }\n}\n\nclass LedgerReader implements LedgerCatalogReader {\n constructor(private readonly market: MarketReader) {}\n\n getAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return this.market.getAssetByLedgerId(ledgerAssetId);\n }\n\n requireAssetByLedgerId(ledgerAssetId: number): AssetConfig {\n return this.getAssetByLedgerId(ledgerAssetId);\n }\n\n getAssetBySymbol(assetSymbol: string): AssetConfig | null {\n return this.market.getAssetBySymbol(assetSymbol);\n }\n\n requireAssetBySymbol(assetSymbol: string): AssetConfig {\n return requireFound(\"ledger\", \"symbol\", assetSymbol, this.getAssetBySymbol(assetSymbol));\n }\n\n getLedgerIdBySymbol(assetSymbol: string): number | null {\n return this.getAssetBySymbol(assetSymbol)?.ledgerId ?? null;\n }\n\n requireLedgerIdBySymbol(assetSymbol: string): number {\n return this.requireAssetBySymbol(assetSymbol).ledgerId;\n }\n\n requireSymbolByLedgerId(ledgerAssetId: number): string {\n return this.requireAssetByLedgerId(ledgerAssetId).symbol;\n }\n\n isKnownAssetId(ledgerAssetId: number): boolean {\n if (!Number.isInteger(ledgerAssetId) || ledgerAssetId <= 0) return false;\n if (ledgerAssetId === UNKNOWN_LEDGER_ASSET_ID) return false;\n return this.market.lookupAssetByLedgerId(ledgerAssetId) !== null;\n }\n\n decimalAmountToScaled(amount: string, asset: AssetCatalogKey): ParsedCatalogAmount {\n return ledgerAmountConverter(this.requireAsset(asset)).parse(amount);\n }\n\n normalizeAmountInput(amount: string, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).normalizeInput(amount);\n }\n\n amountScaledToDecimalString(amountScaled: ScaledIntegerLike, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).toDecimalString(amountScaled);\n }\n\n amountScaledToDisplayString(amountScaled: ScaledIntegerLike, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).toDisplayString(amountScaled);\n }\n\n formatAmount(amount: string, asset: AssetCatalogKey): string {\n return ledgerAmountConverter(this.requireAsset(asset)).formatDecimal(amount);\n }\n\n private requireAsset(asset: AssetCatalogKey): AssetConfig {\n const key = resolveAssetKey(asset);\n const found =\n key.lookup === \"symbol\"\n ? this.getAssetBySymbol(key.value)\n : this.getAssetByLedgerId(key.value);\n return requireFound(\"ledger\", key.lookup, key.value, found);\n }\n}\n\nclass OrdersReader implements OrdersCatalogReader {\n constructor(private readonly market: MarketReader) {}\n\n getSpotOrderConstraints(pair: PairCatalogKey): SpotOrderConstraints {\n const config = this.market.requirePair(pair);\n const priceScale = PRICE_SCALE;\n const quantityScale = config.baseAsset.quantityScale;\n const quoteAmountScale = config.quoteAsset.quantityScale;\n return {\n symbolId: config.symbolId,\n symbol: config.symbol,\n status: config.status,\n tickSize: config.tickSize,\n stepSize: config.stepSize,\n minQtyBase: config.minQtyBase,\n minNotionalQuote: config.minNotionalQuote,\n maxPrice: scaledToDecimal(PROTOBUF_INT64_MAX, priceScale),\n maxQtyBase: scaledToDecimal(PROTOBUF_INT64_MAX, quantityScale),\n maxNotionalQuote: scaledToDecimal(PROTOBUF_INT64_MAX, quoteAmountScale),\n maxQuoteSlippage: scaledToDecimal(PROTOBUF_INT64_MAX, priceScale),\n priceScale,\n quantityScale,\n quoteAmountScale,\n priceDisplayDecimals: priceConverter(config).displayDecimals,\n quantityDisplayDecimals: config.baseAsset.quantityDisplayDecimals,\n quoteAmountDisplayDecimals: config.quoteAsset.quantityDisplayDecimals,\n };\n }\n\n validateSpotOrderDecimalInput(input: SpotOrderDecimalInput): CatalogValidationResult {\n const pair = this.market.requirePair(input.pair);\n const errors: CatalogValidationError[] = [];\n\n const quantityScaled = this.validateQuantity(pair, input.quantity, errors);\n const priceTicks =\n input.price === undefined ? null : this.validatePrice(pair, input.price, errors);\n\n if (quantityScaled !== null && priceTicks !== null) {\n this.validateMinNotional(pair, quantityScaled, priceTicks, errors);\n }\n\n return { valid: errors.length === 0, errors };\n }\n\n assertSpotOrderDecimalInput(input: SpotOrderDecimalInput): void {\n const result = this.validateSpotOrderDecimalInput(input);\n if (!result.valid) throw new CatalogValidationFailedError(result.errors);\n }\n\n private validateQuantity(\n pair: EnrichedPairConfig,\n quantity: string,\n errors: CatalogValidationError[],\n ): bigint | null {\n const scale = pair.baseAsset.quantityScale;\n const parsed = tryDecimalToScaled(quantity, scale);\n if (!parsed.ok) {\n errors.push({\n field: \"quantity\",\n rule: \"parse\",\n message: conversionFailureMessage(\"quantity\", quantity, parsed.failure),\n actual: quantity,\n });\n return null;\n }\n\n if (parsed.scaled > PROTOBUF_INT64_MAX) {\n const maximum = scaledToDecimal(PROTOBUF_INT64_MAX, scale);\n errors.push({\n field: \"quantity\",\n rule: \"maxQty\",\n message: `quantity exceeds the wire-format maximum of ${maximum}`,\n expected: maximum,\n actual: quantity,\n });\n return null;\n }\n\n const step = this.requireConstraintScaled(pair.stepSize, scale, \"stepSize\");\n if (step > 0n && parsed.scaled % step !== 0n) {\n errors.push({\n field: \"quantity\",\n rule: \"stepSize\",\n message: `quantity must be a multiple of the pair step size ${pair.stepSize}`,\n expected: pair.stepSize,\n actual: quantity,\n });\n }\n\n const minQty = this.requireConstraintScaled(pair.minQtyBase, scale, \"minQtyBase\");\n if (parsed.scaled < minQty || parsed.scaled === 0n) {\n errors.push({\n field: \"quantity\",\n rule: \"minQty\",\n message: `quantity is below the pair minimum of ${pair.minQtyBase}`,\n expected: pair.minQtyBase,\n actual: quantity,\n });\n }\n\n return parsed.scaled;\n }\n\n private validatePrice(\n pair: EnrichedPairConfig,\n price: string,\n errors: CatalogValidationError[],\n ): bigint | null {\n const parsed = tryDecimalToScaled(price, PRICE_SCALE);\n if (!parsed.ok) {\n errors.push({\n field: \"price\",\n rule: \"parse\",\n message: conversionFailureMessage(\"price\", price, parsed.failure),\n actual: price,\n });\n return null;\n }\n\n if (parsed.scaled > PROTOBUF_INT64_MAX) {\n const maximum = scaledToDecimal(PROTOBUF_INT64_MAX, PRICE_SCALE);\n errors.push({\n field: \"price\",\n rule: \"maxPrice\",\n message: `price exceeds the wire-format maximum of ${maximum}`,\n expected: maximum,\n actual: price,\n });\n return null;\n }\n\n const tick = this.requireConstraintScaled(pair.tickSize, PRICE_SCALE, \"tickSize\");\n if (tick > 0n && parsed.scaled % tick !== 0n) {\n errors.push({\n field: \"price\",\n rule: \"tickSize\",\n message: `price must be a multiple of the pair tick size ${pair.tickSize}`,\n expected: pair.tickSize,\n actual: price,\n });\n }\n\n return parsed.scaled;\n }\n\n private validateMinNotional(\n pair: EnrichedPairConfig,\n quantityScaled: bigint,\n priceTicks: bigint,\n errors: CatalogValidationError[],\n ): void {\n const notionalScale = pair.baseAsset.quantityScale + PRICE_SCALE;\n const minNotional = this.requireConstraintScaled(\n pair.minNotionalQuote,\n notionalScale,\n \"minNotionalQuote\",\n );\n const notional = quantityScaled * priceTicks;\n if (notional < minNotional) {\n errors.push({\n field: \"notional\",\n rule: \"minNotional\",\n message: `order notional is below the pair minimum of ${pair.minNotionalQuote}`,\n expected: pair.minNotionalQuote,\n actual: scaledToDecimal(notional, notionalScale),\n });\n }\n }\n\n /** Pair constraint strings come from the catalog itself, so failures are data bugs. */\n private requireConstraintScaled(decimal: string, scale: number, field: string): bigint {\n const result = tryDecimalToScaled(decimal, scale);\n if (!result.ok) {\n throw new CatalogConversionError(\n field,\n conversionFailureMessage(field, decimal, result.failure),\n );\n }\n return result.scaled;\n }\n}\n\nclass ZipperReader implements ZipperCatalogReader {\n constructor(private readonly getSnapshot: SnapshotGetter) {}\n\n listChains(): readonly ZipperChainConfig[] {\n return this.getSnapshot().zipper.chains;\n }\n\n getChain(chain: ChainCatalogKey): ZipperChainConfig | null {\n const key = resolveChainKey(chain);\n return key.lookup === \"chainCode\"\n ? this.getChainByCode(key.value)\n : this.getChainById(key.value);\n }\n\n requireChain(chain: ChainCatalogKey): ZipperChainConfig {\n const key = resolveChainKey(chain);\n return requireFound(\"zipper\", key.lookup, key.value, this.getChain(chain));\n }\n\n getChainByCode(chainCode: string): ZipperChainConfig | null {\n return indexesFor(this.getSnapshot()).zipperChainByCode.get(chainCode) ?? null;\n }\n\n requireChainByCode(chainCode: string): ZipperChainConfig {\n return requireFound(\"zipper\", \"chainCode\", chainCode, this.getChainByCode(chainCode));\n }\n\n getChainById(chainId: number): ZipperChainConfig | null {\n return indexesFor(this.getSnapshot()).zipperChainById.get(chainId) ?? null;\n }\n\n requireChainById(chainId: number): ZipperChainConfig {\n return requireFound(\"zipper\", \"chainId\", chainId, this.getChainById(chainId));\n }\n\n getChainIdByCode(chainCode: string): number | null {\n return this.getChainByCode(chainCode)?.chainId ?? null;\n }\n\n requireChainIdByCode(chainCode: string): number {\n return this.requireChainByCode(chainCode).chainId;\n }\n\n listAssets(): readonly ZipperEnrichedAssetConfig[] {\n return this.getSnapshot().zipper.assets;\n }\n\n getAsset(asset: AssetCatalogKey): ZipperEnrichedAssetConfig | null {\n const key = resolveAssetKey(asset);\n return key.lookup === \"symbol\"\n ? this.getAssetBySymbol(key.value)\n : this.getAssetByLedgerId(key.value);\n }\n\n requireAsset(asset: AssetCatalogKey): ZipperEnrichedAssetConfig {\n const key = resolveAssetKey(asset);\n return requireFound(\"zipper\", key.lookup, key.value, this.getAsset(asset));\n }\n\n getAssetBySymbol(assetSymbol: string): ZipperEnrichedAssetConfig | null {\n return indexesFor(this.getSnapshot()).zipperAssetBySymbol.get(assetSymbol) ?? null;\n }\n\n requireAssetBySymbol(assetSymbol: string): ZipperEnrichedAssetConfig {\n return requireFound(\"zipper\", \"symbol\", assetSymbol, this.getAssetBySymbol(assetSymbol));\n }\n\n getAssetByLedgerId(ledgerAssetId: number): ZipperEnrichedAssetConfig {\n return resolveZipperAssetByLedgerId(ledgerAssetId, (id) => this.lookupAssetByLedgerId(id));\n }\n\n lookupAssetByLedgerId(ledgerAssetId: number): ZipperEnrichedAssetConfig | null {\n return indexesFor(this.getSnapshot()).zipperAssetByLedgerId.get(ledgerAssetId) ?? null;\n }\n\n requireAssetByLedgerId(ledgerAssetId: number): ZipperEnrichedAssetConfig {\n return this.getAssetByLedgerId(ledgerAssetId);\n }\n\n getAssetByUAssetId(uAssetId: string): ZipperEnrichedAssetConfig | null {\n return indexesFor(this.getSnapshot()).zipperAssetByUAssetId.get(uAssetId) ?? null;\n }\n\n requireAssetByUAssetId(uAssetId: string): ZipperEnrichedAssetConfig {\n return requireFound(\"zipper\", \"uAssetId\", uAssetId, this.getAssetByUAssetId(uAssetId));\n }\n\n getAssetChain(asset: AssetCatalogKey, chain: ChainCatalogKey): ZipperAssetChainRoute | null {\n const zipperAsset = this.getAsset(asset);\n const zipperChain = this.getChain(chain);\n if (!zipperAsset || !zipperChain) return null;\n const route = zipperAsset.chains.find(\n (candidate) => candidate.chainId === zipperChain.chainId,\n );\n return route ? { asset: zipperAsset, chain: route } : null;\n }\n\n requireAssetChain(asset: AssetCatalogKey, chain: ChainCatalogKey): ZipperAssetChainRoute {\n const route = this.getAssetChain(asset, chain);\n if (!route) {\n throw new CatalogLookupError(\n \"zipper\",\n \"assetChain\",\n `${formatKey(resolveAssetKey(asset))}:${formatKey(resolveChainKey(chain))}`,\n );\n }\n return route;\n }\n\n getAssetChainByZippedAssetId(zippedAssetId: number): ZipperAssetChainRoute | null {\n return indexesFor(this.getSnapshot()).zipperRouteByZippedAssetId.get(zippedAssetId) ?? null;\n }\n\n requireAssetChainByZippedAssetId(zippedAssetId: number): ZipperAssetChainRoute {\n return requireFound(\n \"zipper\",\n \"zippedAssetId\",\n zippedAssetId,\n this.getAssetChainByZippedAssetId(zippedAssetId),\n );\n }\n\n getZippedAssetId(asset: AssetCatalogKey, chain: ChainCatalogKey): number | null {\n return this.getAssetChain(asset, chain)?.chain.zippedAssetId ?? null;\n }\n\n requireZippedAssetId(asset: AssetCatalogKey, chain: ChainCatalogKey): number {\n return this.requireAssetChain(asset, chain).chain.zippedAssetId;\n }\n\n listContracts(): readonly ZipperChainContractConfig[] {\n return this.getSnapshot().zipper.contracts;\n }\n\n getContract(contractName: ZipperContractName): ZipperChainContractConfig | null {\n return this.getContractByName(contractName);\n }\n\n requireContract(contractName: ZipperContractName): ZipperChainContractConfig {\n return this.requireContractByName(contractName);\n }\n\n getContractByName(contractName: ZipperContractName): ZipperChainContractConfig | null {\n return indexesFor(this.getSnapshot()).zipperContractByName.get(contractName) ?? null;\n }\n\n requireContractByName(contractName: ZipperContractName): ZipperChainContractConfig {\n return requireFound(\n \"zipper\",\n \"contractName\",\n contractName,\n this.getContractByName(contractName),\n );\n }\n}\n\nfunction formatKey(key: { lookup: string; value: string | number }): string {\n return String(key.value);\n}\n\nclass SnapshotCatalogReader implements CatalogReader {\n readonly market: MarketCatalogReader;\n readonly ledger: LedgerCatalogReader;\n readonly orders: OrdersCatalogReader;\n readonly zipper: ZipperCatalogReader;\n readonly snapshot: () => CatalogSnapshot;\n\n constructor(getSnapshot: SnapshotGetter) {\n const market = new MarketReader(getSnapshot);\n this.market = market;\n this.ledger = new LedgerReader(market);\n this.orders = new OrdersReader(market);\n this.zipper = new ZipperReader(getSnapshot);\n this.snapshot = () => getSnapshot();\n }\n}\n\nexport function createReader(getSnapshot: () => CatalogSnapshot): CatalogReader {\n return new SnapshotCatalogReader(getSnapshot);\n}\n\nexport function createCatalogSnapshotReader(snapshot: CatalogSnapshot): CatalogReader {\n const parsed = parseCatalogSnapshot(snapshot);\n return createReader(() => parsed);\n}\n"],"mappings":";;;;;;AAoDA,SAAS,SAAS,MAA0B,OAAwB;CAChE,IAAI,KAAK,cAAc,QAAQ,KAAK,YAAY,OAAO,OAAO;CAC9D,IAAI,KAAK,WAAW,YAAY,OAAO;C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;EACrC,KAAK,SAAS,IAAI,aAAa,WAAW;EAC1C,KAAK,iBAAiB,YAAY;CACtC;AACJ;AAEA,SAAgB,aAAa,aAAmD;CAC5E,OAAO,IAAI,sBAAsB,WAAW;AAChD;AAEA,SAAgB,4BAA4B,UAA0C;CAClF,MAAM,SAAS,qBAAqB,QAAQ;CAC5C,OAAO,mBAAmB,MAAM;AACpC"}
|
|
@@ -162,7 +162,7 @@ type SubaccountPolicyView = Message<"auth.v1.SubaccountPolicyView"> & {
|
|
|
162
162
|
/**
|
|
163
163
|
* When true, new orders and exposure-increasing order or trigger changes are
|
|
164
164
|
* rejected regardless of other settings. Existing orders and triggers may
|
|
165
|
-
* still be canceled or paused.
|
|
165
|
+
* still be canceled or paused by an otherwise authorized caller.
|
|
166
166
|
*
|
|
167
167
|
* @generated from field: bool trading_halted = 23;
|
|
168
168
|
*/
|
|
@@ -356,7 +356,7 @@ type SubaccountPolicySpec = Message<"auth.v1.SubaccountPolicySpec"> & {
|
|
|
356
356
|
/**
|
|
357
357
|
* When true, new orders and exposure-increasing order or trigger changes are
|
|
358
358
|
* rejected regardless of other settings. Existing orders and triggers may
|
|
359
|
-
* still be canceled or paused.
|
|
359
|
+
* still be canceled or paused by an otherwise authorized caller.
|
|
360
360
|
*
|
|
361
361
|
* @generated from field: bool trading_halted = 21;
|
|
362
362
|
*/
|
|
@@ -953,9 +953,11 @@ declare enum PolicyAction {
|
|
|
953
953
|
*/
|
|
954
954
|
UNSPECIFIED = 0,
|
|
955
955
|
/**
|
|
956
|
-
* Allow
|
|
957
|
-
*
|
|
958
|
-
*
|
|
956
|
+
* Allow all spot order mutations: create, modify, replace, cancel, batch
|
|
957
|
+
* operations, live cancel-all, and arming or disabling cancel-all-after.
|
|
958
|
+
* Includes reading spot orders and trades and placing or modifying triggers.
|
|
959
|
+
* Authorized cancellation remains available when trading activity is disabled;
|
|
960
|
+
* this does not grant mutation access to a read-only API key.
|
|
959
961
|
*
|
|
960
962
|
* @generated from enum value: TRADE_SPOT = 1;
|
|
961
963
|
*/
|
|
@@ -981,7 +983,8 @@ declare enum PolicyAction {
|
|
|
981
983
|
*/
|
|
982
984
|
READ_BALANCES = 5,
|
|
983
985
|
/**
|
|
984
|
-
* Allow reading spot orders and trades
|
|
986
|
+
* Allow reading spot orders and trades, subscriptions, and cancel-all dry-run.
|
|
987
|
+
* Strictly non-mutating: cancellation and cancel-all-after changes require TRADE_SPOT.
|
|
985
988
|
*
|
|
986
989
|
* @generated from enum value: READ_SPOT = 6;
|
|
987
990
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies_pb.d.ts","names":[],"sources":["../../../../src/gen/auth/v1/policies_pb.ts"],"mappings":";;;;;;;;;cAca,uBAAuB;;;;;;KAQxB,cAAc;;;;;cAOb,mBAAmB,WAAW;;;;;;;;aAU/B;;;;;;EAMV;;;;;;EAOA;;;;;;EAOA;;;;;cAMW,yBAAyB,QAAQ;;;;;;KAQlC,qBAAqB;;;;;;EAM/B;;;;;;cAOW,0BAA0B,WAAW;;;;;;KAQtC,iBAAiB;;;;;;EAM3B;;;;;;cAOW,sBAAsB,WAAW;;;;;;KAQlC,uBAAuB;;;;;;EAMjC;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA,aAAa;;;;;;;EAQb,iBAAiB;;;;;;;EAQjB,SAAS;;;;;;;EAQT;;;;;;;EAQA;;;;;;;;EASA;;;;;;;EAQA;;;;;;;;EASA;;;;;;;EAQA;;;;;;;EAQA,WAAW;;;;;;;EAQX,YAAY;;;;;;EAOZ,YAAY;;;;;;EAOZ,YAAY;;;;;;EAOZ;;;;;;cAOW,4BAA4B,WAAW;;;;;;;;KAUxC,gCAAgC;;;;;;;;;EAS1C;;;;;;cAOW,qCAAqC,WAAW;;;;;;;KASjD,iCAAiC;;;;;;EAM3C,UAAU;;;;;;cAOC,sCAAsC,WAAW;;;;;;KAQlD,6BAA6B;;;;;;EAMvC;;;;;;;;;EAUA;;;;;;cAOW,kCAAkC,WAAW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AQ3C,yBAAyB;;;;;;;EAOnC;;;;;;;EAQA;;;;;;cAOW,8BAA8B,WAAW;;;;;;KAQ1C,0BAA0B;;;;;cAOzB,+BAA+B,WAAW;;;;;;;;aAU3C;;;;;;;EAOV;;;;;;;;;;EAWA;;;;;;;EAQA;;;;;;;EAQA;;;;;;EAOA;;;;;;;EAQA;;;;;;EAOA;;;;;;EAOA;;;;;;;EAQA;;;;;cAMW,oBAAoB,QAAQ;;;;;;cAQ5B,eAAe;;;;;;EAM1B;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe"}
|
|
@@ -253,9 +253,11 @@ let PolicyAction = /* @__PURE__ */ function(PolicyAction) {
|
|
|
253
253
|
*/
|
|
254
254
|
PolicyAction[PolicyAction["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
255
255
|
/**
|
|
256
|
-
* Allow
|
|
257
|
-
*
|
|
258
|
-
*
|
|
256
|
+
* Allow all spot order mutations: create, modify, replace, cancel, batch
|
|
257
|
+
* operations, live cancel-all, and arming or disabling cancel-all-after.
|
|
258
|
+
* Includes reading spot orders and trades and placing or modifying triggers.
|
|
259
|
+
* Authorized cancellation remains available when trading activity is disabled;
|
|
260
|
+
* this does not grant mutation access to a read-only API key.
|
|
259
261
|
*
|
|
260
262
|
* @generated from enum value: TRADE_SPOT = 1;
|
|
261
263
|
*/
|
|
@@ -281,7 +283,8 @@ let PolicyAction = /* @__PURE__ */ function(PolicyAction) {
|
|
|
281
283
|
*/
|
|
282
284
|
PolicyAction[PolicyAction["READ_BALANCES"] = 5] = "READ_BALANCES";
|
|
283
285
|
/**
|
|
284
|
-
* Allow reading spot orders and trades
|
|
286
|
+
* Allow reading spot orders and trades, subscriptions, and cancel-all dry-run.
|
|
287
|
+
* Strictly non-mutating: cancellation and cancel-all-after changes require TRADE_SPOT.
|
|
285
288
|
*
|
|
286
289
|
* @generated from enum value: READ_SPOT = 6;
|
|
287
290
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies_pb.js","names":[],"sources":["../../../../src/gen/auth/v1/policies_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file auth/v1/policies.proto (package auth.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { FieldMask, Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_field_mask, file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_polyester_api_options } from \"../../polyester/api/options_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file auth/v1/policies.proto.\n */\nexport const file_auth_v1_policies: GenFile = /*@__PURE__*/\n fileDesc(\"ChZhdXRoL3YxL3BvbGljaWVzLnByb3RvEgdhdXRoLnYxIj8KC01hcmtldFNjb3BlIjAKBVZhbHVlEg8KC1VOU1BFQ0lGSUVEEAASBwoDQUxMEAESDQoJQUxMT1dMSVNUEAIiKQoSU3BvdE1hcmtldFNlbGVjdG9yEhMKCXN5bWJvbF9pZBgBIAEoDUIAIiMKDlNwb3RNYXJr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1dGgudjEuRGVsZXRlQXBpUG9saWN5UmVxdWVzdBogLmF1dGgudjEuRGVsZXRlQXBpUG9saWN5UmVzcG9uc2UiABJWCg9TZXRBcGlLZXlQb2xpY3kSHy5hdXRoLnYxLlNldEFwaUtleVBvbGljeVJlcXVlc3QaIC5hdXRoLnYxLlNldEFwaUtleVBvbGljeVJlc3BvbnNlIgBCPFo6Z2l0aHViLmNvbS9GYWJyaWMtTGFicy9wb2x5ZXN0ZXItc2RrLWdvL2dlbi9hdXRoL3YxO2F1dGh2MWIGcHJvdG8z\", [file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_polyester_api_options]);\n\n/**\n * MarketScope describes how a policy applies to spot markets.\n *\n * @generated from message auth.v1.MarketScope\n */\nexport type MarketScope = Message<\"auth.v1.MarketScope\"> & {\n};\n\n/**\n * Describes the message auth.v1.MarketScope.\n * Use `create(MarketScopeSchema)` to create a new message.\n */\nexport const MarketScopeSchema: GenMessage<MarketScope> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 0);\n\n/**\n * Value is the market-level scope:\n * - ALL: no market-level restriction; new listings are automatically allowed.\n * - ALLOWLIST: only the listed markets are allowed.\n *\n * @generated from enum auth.v1.MarketScope.Value\n */\nexport enum MarketScope_Value {\n /**\n * No scope selected. Create and update requests treat this as ALL.\n *\n * @generated from enum value: UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Allow all current and future markets for this policy.\n *\n * @generated from enum value: ALL = 1;\n */\n ALL = 1,\n\n /**\n * Allow only the markets listed on this policy.\n *\n * @generated from enum value: ALLOWLIST = 2;\n */\n ALLOWLIST = 2,\n}\n\n/**\n * Describes the enum auth.v1.MarketScope.Value.\n */\nexport const MarketScope_ValueSchema: GenEnum<MarketScope_Value> = /*@__PURE__*/\n enumDesc(file_auth_v1_policies, 0, 0);\n\n/**\n * SpotMarketSelector identifies an allowed spot market in policy mutations.\n *\n * @generated from message auth.v1.SpotMarketSelector\n */\nexport type SpotMarketSelector = Message<\"auth.v1.SpotMarketSelector\"> & {\n /**\n * Stable numeric pair ID from GetSpotConfig.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n};\n\n/**\n * Describes the message auth.v1.SpotMarketSelector.\n * Use `create(SpotMarketSelectorSchema)` to create a new message.\n */\nexport const SpotMarketSelectorSchema: GenMessage<SpotMarketSelector> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 1);\n\n/**\n * SpotMarketRule describes an allowed spot market in policy views.\n *\n * @generated from message auth.v1.SpotMarketRule\n */\nexport type SpotMarketRule = Message<\"auth.v1.SpotMarketRule\"> & {\n /**\n * Stable numeric pair ID.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n};\n\n/**\n * Describes the message auth.v1.SpotMarketRule.\n * Use `create(SpotMarketRuleSchema)` to create a new message.\n */\nexport const SpotMarketRuleSchema: GenMessage<SpotMarketRule> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 2);\n\n/**\n * SubaccountPolicyView is the public view of a sub-account policy.\n *\n * @generated from message auth.v1.SubaccountPolicyView\n */\nexport type SubaccountPolicyView = Message<\"auth.v1.SubaccountPolicyView\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 id = 1;\n */\n id: bigint;\n\n /**\n * Human-readable policy name.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits.\n *\n * @generated from field: string description = 3;\n */\n description: string;\n\n /**\n * Allowed spot markets for this sub-account.\n *\n * @generated from field: repeated auth.v1.SpotMarketRule spot_markets = 4;\n */\n spotMarkets: SpotMarketRule[];\n\n /**\n * Market-level scope for spot markets. When ALL, spot_markets is returned\n * for display only and is not enforced.\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 6;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * Effective high-level actions enabled for the sub-account. Mandatory\n * read-only actions are always included.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 8;\n */\n actions: PolicyAction[];\n\n /**\n * True if this policy is a reusable template; false if it is a\n * per-sub-account instance.\n *\n * @generated from field: bool is_template = 10;\n */\n isTemplate: boolean;\n\n /**\n * Optional source template this policy was copied from (opaque ID). This is\n * audit metadata only and does not imply live linkage.\n *\n * @generated from field: fixed64 source_template_id = 11;\n */\n sourceTemplateId: bigint;\n\n /**\n * Maximum notional size allowed for any single order on this sub-account,\n * expressed in canonical quote microunits (one unit is 0.000001 USDT).\n * A value of 0 means \"no explicit cap\".\n *\n * @generated from field: uint64 max_order_notional = 13;\n */\n maxOrderNotional: bigint;\n\n /**\n * Maximum number of resting orders allowed on this sub-account at any time.\n * A value of 0 means \"no explicit cap\".\n *\n * @generated from field: uint32 max_open_orders = 14;\n */\n maxOpenOrders: number;\n\n /**\n * When true, new orders and exposure-increasing order or trigger changes are\n * rejected regardless of other settings. Existing orders and triggers may\n * still be canceled or paused.\n *\n * @generated from field: bool trading_halted = 23;\n */\n tradingHalted: boolean;\n\n /**\n * When true, this policy is write-protected and requires an elevated approval\n * flow to modify it.\n *\n * @generated from field: bool locked = 27;\n */\n locked: boolean;\n\n /**\n * Optional review time in UTC. This is governance metadata and does not\n * automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp review_at = 28;\n */\n reviewAt?: Timestamp | undefined;\n\n /**\n * Optional expiry time in UTC. This is governance metadata and does not\n * automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 29;\n */\n expiresAt?: Timestamp | undefined;\n\n /**\n * Creation time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 20;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Last update time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp updated_at = 21;\n */\n updatedAt?: Timestamp | undefined;\n\n /**\n * Monotonic resource revision used for conditional updates.\n *\n * @generated from field: uint64 revision = 30;\n */\n revision: bigint;\n};\n\n/**\n * Describes the message auth.v1.SubaccountPolicyView.\n * Use `create(SubaccountPolicyViewSchema)` to create a new message.\n */\nexport const SubaccountPolicyViewSchema: GenMessage<SubaccountPolicyView> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 3);\n\n/**\n * ListSubaccountPoliciesRequest lists the finite set of sub-account policies\n * visible in the requested account scope. Results are sorted by ascending\n * policy ID and are not paginated.\n *\n * @generated from message auth.v1.ListSubaccountPoliciesRequest\n */\nexport type ListSubaccountPoliciesRequest = Message<\"auth.v1.ListSubaccountPoliciesRequest\"> & {\n /**\n * Optional sub-account context. When provided, a current member may read the\n * policy attached to that sub-account; the owner retains visibility of all\n * policies owned by their root account. When omitted, only policies owned by\n * the caller's root account are returned.\n *\n * @generated from field: optional fixed64 subaccount_id = 1;\n */\n subaccountId?: bigint | undefined;\n};\n\n/**\n * Describes the message auth.v1.ListSubaccountPoliciesRequest.\n * Use `create(ListSubaccountPoliciesRequestSchema)` to create a new message.\n */\nexport const ListSubaccountPoliciesRequestSchema: GenMessage<ListSubaccountPoliciesRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 4);\n\n/**\n * ListSubaccountPoliciesResponse contains sub-account policy templates sorted\n * by ascending policy ID.\n *\n * @generated from message auth.v1.ListSubaccountPoliciesResponse\n */\nexport type ListSubaccountPoliciesResponse = Message<\"auth.v1.ListSubaccountPoliciesResponse\"> & {\n /**\n * Sub-account policy templates visible to the caller.\n *\n * @generated from field: repeated auth.v1.SubaccountPolicyView policies = 1;\n */\n policies: SubaccountPolicyView[];\n};\n\n/**\n * Describes the message auth.v1.ListSubaccountPoliciesResponse.\n * Use `create(ListSubaccountPoliciesResponseSchema)` to create a new message.\n */\nexport const ListSubaccountPoliciesResponseSchema: GenMessage<ListSubaccountPoliciesResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 5);\n\n/**\n * GetSubaccountPolicyRequest fetches one sub-account policy template by ID.\n *\n * @generated from message auth.v1.GetSubaccountPolicyRequest\n */\nexport type GetSubaccountPolicyRequest = Message<\"auth.v1.GetSubaccountPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Optional sub-account context. When provided, a current member may read the\n * policy attached to that sub-account; the owner may also read another policy\n * owned by their root account. When omitted, the policy must be owned by the\n * caller's root account.\n *\n * @generated from field: optional fixed64 subaccount_id = 2;\n */\n subaccountId?: bigint | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetSubaccountPolicyRequest.\n * Use `create(GetSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const GetSubaccountPolicyRequestSchema: GenMessage<GetSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 6);\n\n/**\n * GetSubaccountPolicyResponse returns the requested sub-account policy.\n *\n * @generated from message auth.v1.GetSubaccountPolicyResponse\n */\nexport type GetSubaccountPolicyResponse = Message<\"auth.v1.GetSubaccountPolicyResponse\"> & {\n /**\n * Matching sub-account policy.\n *\n * @generated from field: auth.v1.SubaccountPolicyView policy = 1;\n */\n policy?: SubaccountPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetSubaccountPolicyResponse.\n * Use `create(GetSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const GetSubaccountPolicyResponseSchema: GenMessage<GetSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 7);\n\n/**\n * SubaccountPolicySpec contains the mutable configuration of a sub-account policy.\n *\n * @generated from message auth.v1.SubaccountPolicySpec\n */\nexport type SubaccountPolicySpec = Message<\"auth.v1.SubaccountPolicySpec\"> & {\n /**\n * Human-readable policy name. Create requires a non-empty value; update\n * validates it after merging fields selected by update_mask.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits. Maximum 256 characters.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * Allowed spot markets for this policy.\n *\n * @generated from field: repeated auth.v1.SpotMarketSelector spot_markets = 3;\n */\n spotMarkets: SpotMarketSelector[];\n\n /**\n * Market-level scope for spot markets. When unspecified, defaults to ALL.\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 5;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * High-level actions enabled for the sub-account policy. Mandatory read-only\n * actions are included when omitted. Up to 64 unique explicit actions are\n * allowed.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 7;\n */\n actions: PolicyAction[];\n\n /**\n * Maximum notional size for any single order on this sub-account, expressed\n * in canonical quote microunits (one unit is 0.000001 USDT). A value of 0\n * means no explicit cap.\n *\n * @generated from field: uint64 max_order_notional = 13;\n */\n maxOrderNotional: bigint;\n\n /**\n * Maximum number of resting orders allowed on this sub-account at any time.\n * A value of 0 means no explicit cap.\n *\n * @generated from field: uint32 max_open_orders = 14;\n */\n maxOpenOrders: number;\n\n /**\n * When true, new orders and exposure-increasing order or trigger changes are\n * rejected regardless of other settings. Existing orders and triggers may\n * still be canceled or paused.\n *\n * @generated from field: bool trading_halted = 21;\n */\n tradingHalted: boolean;\n\n /**\n * When true, the policy is write-protected and requires an elevated mutation path.\n *\n * @generated from field: bool locked = 25;\n */\n locked: boolean;\n\n /**\n * Optional review time in UTC. This does not automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp review_at = 26;\n */\n reviewAt?: Timestamp | undefined;\n\n /**\n * Optional expiry time in UTC. This does not automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 27;\n */\n expiresAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message auth.v1.SubaccountPolicySpec.\n * Use `create(SubaccountPolicySpecSchema)` to create a new message.\n */\nexport const SubaccountPolicySpecSchema: GenMessage<SubaccountPolicySpec> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 8);\n\n/**\n * CreateSubaccountPolicyRequest defines a new sub-account policy template, with\n * an optional attach step for one target sub-account.\n *\n * @generated from message auth.v1.CreateSubaccountPolicyRequest\n */\nexport type CreateSubaccountPolicyRequest = Message<\"auth.v1.CreateSubaccountPolicyRequest\"> & {\n /**\n * Complete mutable policy configuration.\n *\n * @generated from field: auth.v1.SubaccountPolicySpec policy = 1;\n */\n policy?: SubaccountPolicySpec | undefined;\n\n /**\n * Optional target sub-account to attach atomically after creation.\n *\n * @generated from field: optional fixed64 subaccount_id = 2;\n */\n subaccountId?: bigint | undefined;\n};\n\n/**\n * Describes the message auth.v1.CreateSubaccountPolicyRequest.\n * Use `create(CreateSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const CreateSubaccountPolicyRequestSchema: GenMessage<CreateSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 9);\n\n/**\n * CreateSubaccountPolicyResponse returns the created sub-account policy.\n *\n * @generated from message auth.v1.CreateSubaccountPolicyResponse\n */\nexport type CreateSubaccountPolicyResponse = Message<\"auth.v1.CreateSubaccountPolicyResponse\"> & {\n /**\n * Created sub-account policy.\n *\n * @generated from field: auth.v1.SubaccountPolicyView policy = 1;\n */\n policy?: SubaccountPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.CreateSubaccountPolicyResponse.\n * Use `create(CreateSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const CreateSubaccountPolicyResponseSchema: GenMessage<CreateSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 10);\n\n/**\n * UpdateSubaccountPolicyRequest changes selected mutable fields on an existing\n * sub-account policy.\n *\n * @generated from message auth.v1.UpdateSubaccountPolicyRequest\n */\nexport type UpdateSubaccountPolicyRequest = Message<\"auth.v1.UpdateSubaccountPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Candidate values for fields selected by update_mask.\n *\n * @generated from field: auth.v1.SubaccountPolicySpec policy = 2;\n */\n policy?: SubaccountPolicySpec | undefined;\n\n /**\n * Mutable fields to apply. Paths are relative to policy. The mask is required,\n * must be non-empty, and cannot contain \"*\".\n *\n * @generated from field: google.protobuf.FieldMask update_mask = 3;\n */\n updateMask?: FieldMask | undefined;\n\n /**\n * Revision returned by the latest successful read. Stale revisions fail with\n * a conflict before no-op detection.\n *\n * @generated from field: uint64 expected_revision = 4;\n */\n expectedRevision: bigint;\n};\n\n/**\n * Describes the message auth.v1.UpdateSubaccountPolicyRequest.\n * Use `create(UpdateSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const UpdateSubaccountPolicyRequestSchema: GenMessage<UpdateSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 11);\n\n/**\n * UpdateSubaccountPolicyResponse returns the updated sub-account policy.\n *\n * @generated from message auth.v1.UpdateSubaccountPolicyResponse\n */\nexport type UpdateSubaccountPolicyResponse = Message<\"auth.v1.UpdateSubaccountPolicyResponse\"> & {\n /**\n * Updated sub-account policy.\n *\n * @generated from field: auth.v1.SubaccountPolicyView policy = 1;\n */\n policy?: SubaccountPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.UpdateSubaccountPolicyResponse.\n * Use `create(UpdateSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const UpdateSubaccountPolicyResponseSchema: GenMessage<UpdateSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 12);\n\n/**\n * DeleteSubaccountPolicyRequest deletes a sub-account policy template when it\n * is not in use.\n *\n * @generated from message auth.v1.DeleteSubaccountPolicyRequest\n */\nexport type DeleteSubaccountPolicyRequest = Message<\"auth.v1.DeleteSubaccountPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.DeleteSubaccountPolicyRequest.\n * Use `create(DeleteSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const DeleteSubaccountPolicyRequestSchema: GenMessage<DeleteSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 13);\n\n/**\n * DeleteSubaccountPolicyResponse is empty when the delete succeeds.\n *\n * @generated from message auth.v1.DeleteSubaccountPolicyResponse\n */\nexport type DeleteSubaccountPolicyResponse = Message<\"auth.v1.DeleteSubaccountPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.DeleteSubaccountPolicyResponse.\n * Use `create(DeleteSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const DeleteSubaccountPolicyResponseSchema: GenMessage<DeleteSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 14);\n\n/**\n * SetSubaccountPolicyRequest attaches or clears a policy template on a\n * sub-account.\n *\n * @generated from message auth.v1.SetSubaccountPolicyRequest\n */\nexport type SetSubaccountPolicyRequest = Message<\"auth.v1.SetSubaccountPolicyRequest\"> & {\n /**\n * Sub-account identifier (opaque ID).\n *\n * @generated from field: fixed64 subaccount_id = 1;\n */\n subaccountId: bigint;\n\n /**\n * Policy template to attach (opaque ID). A value of 0 clears the explicit\n * binding and restores the system Read Only policy.\n *\n * @generated from field: fixed64 policy_id = 2;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.SetSubaccountPolicyRequest.\n * Use `create(SetSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const SetSubaccountPolicyRequestSchema: GenMessage<SetSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 15);\n\n/**\n * SetSubaccountPolicyResponse is empty when the policy binding succeeds.\n *\n * @generated from message auth.v1.SetSubaccountPolicyResponse\n */\nexport type SetSubaccountPolicyResponse = Message<\"auth.v1.SetSubaccountPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.SetSubaccountPolicyResponse.\n * Use `create(SetSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const SetSubaccountPolicyResponseSchema: GenMessage<SetSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 16);\n\n/**\n * ApiPolicyView is the public view of an API key policy template. Its action\n * and spot-market floor cannot exceed an attached sub-account policy.\n *\n * @generated from message auth.v1.ApiPolicyView\n */\nexport type ApiPolicyView = Message<\"auth.v1.ApiPolicyView\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 id = 1;\n */\n id: bigint;\n\n /**\n * Human-readable policy name.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits.\n *\n * @generated from field: string description = 3;\n */\n description: string;\n\n /**\n * Allowed spot markets for this API key policy.\n *\n * @generated from field: repeated auth.v1.SpotMarketRule spot_markets = 4;\n */\n spotMarkets: SpotMarketRule[];\n\n /**\n * High-level actions enabled for this API key. Up to 64 unique explicit\n * actions may be returned.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 6;\n */\n actions: PolicyAction[];\n\n /**\n * Market-level scope for spot markets. When ALL, spot_markets is returned\n * for display only and is not enforced.\n *\n * --- Template / lifecycle metadata ---\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 7;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * When true, this policy is intended to be reused as a template across\n * multiple API keys. When false, it represents a single-key instance.\n *\n * @generated from field: bool is_template = 19;\n */\n isTemplate: boolean;\n\n /**\n * Optional source template this policy was copied from (opaque ID). This is\n * audit metadata only and does not imply live linkage.\n *\n * @generated from field: fixed64 source_template_id = 20;\n */\n sourceTemplateId: bigint;\n\n /**\n * Creation time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 21;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Last update time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp updated_at = 22;\n */\n updatedAt?: Timestamp | undefined;\n\n /**\n * Monotonic resource revision used for conditional updates.\n *\n * @generated from field: uint64 revision = 23;\n */\n revision: bigint;\n};\n\n/**\n * Describes the message auth.v1.ApiPolicyView.\n * Use `create(ApiPolicyViewSchema)` to create a new message.\n */\nexport const ApiPolicyViewSchema: GenMessage<ApiPolicyView> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 17);\n\n/**\n * ListApiPoliciesRequest lists the finite set of API key policies visible in\n * the requested account scope. Results are sorted by ascending policy ID and\n * are not paginated.\n *\n * @generated from message auth.v1.ListApiPoliciesRequest\n */\nexport type ListApiPoliciesRequest = Message<\"auth.v1.ListApiPoliciesRequest\"> & {\n /**\n * Optional API key context for delegated administration. When omitted, only\n * policies owned by the caller's root account are returned.\n *\n * @generated from field: optional string key_id = 1;\n */\n keyId?: string | undefined;\n};\n\n/**\n * Describes the message auth.v1.ListApiPoliciesRequest.\n * Use `create(ListApiPoliciesRequestSchema)` to create a new message.\n */\nexport const ListApiPoliciesRequestSchema: GenMessage<ListApiPoliciesRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 18);\n\n/**\n * ListApiPoliciesResponse contains API key policy templates sorted by ascending\n * policy ID.\n *\n * @generated from message auth.v1.ListApiPoliciesResponse\n */\nexport type ListApiPoliciesResponse = Message<\"auth.v1.ListApiPoliciesResponse\"> & {\n /**\n * API key policy templates visible to the caller.\n *\n * @generated from field: repeated auth.v1.ApiPolicyView policies = 1;\n */\n policies: ApiPolicyView[];\n};\n\n/**\n * Describes the message auth.v1.ListApiPoliciesResponse.\n * Use `create(ListApiPoliciesResponseSchema)` to create a new message.\n */\nexport const ListApiPoliciesResponseSchema: GenMessage<ListApiPoliciesResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 19);\n\n/**\n * GetApiPolicyRequest fetches one API key policy template by ID.\n *\n * @generated from message auth.v1.GetApiPolicyRequest\n */\nexport type GetApiPolicyRequest = Message<\"auth.v1.GetApiPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Optional API key context for delegated administration. When omitted, the\n * policy must be owned by the caller's root account.\n *\n * @generated from field: optional string key_id = 2;\n */\n keyId?: string | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetApiPolicyRequest.\n * Use `create(GetApiPolicyRequestSchema)` to create a new message.\n */\nexport const GetApiPolicyRequestSchema: GenMessage<GetApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 20);\n\n/**\n * GetApiPolicyResponse returns the requested API key policy.\n *\n * @generated from message auth.v1.GetApiPolicyResponse\n */\nexport type GetApiPolicyResponse = Message<\"auth.v1.GetApiPolicyResponse\"> & {\n /**\n * Matching API key policy.\n *\n * @generated from field: auth.v1.ApiPolicyView policy = 1;\n */\n policy?: ApiPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetApiPolicyResponse.\n * Use `create(GetApiPolicyResponseSchema)` to create a new message.\n */\nexport const GetApiPolicyResponseSchema: GenMessage<GetApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 21);\n\n/**\n * ApiPolicySpec contains the mutable configuration of an API key policy.\n *\n * @generated from message auth.v1.ApiPolicySpec\n */\nexport type ApiPolicySpec = Message<\"auth.v1.ApiPolicySpec\"> & {\n /**\n * Human-readable policy name. Create requires a non-empty value; update\n * validates it after merging fields selected by update_mask.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits. Maximum 256 characters.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * Allowed spot markets for this API key policy.\n *\n * @generated from field: repeated auth.v1.SpotMarketSelector spot_markets = 3;\n */\n spotMarkets: SpotMarketSelector[];\n\n /**\n * Market-level scope for spot markets. When unspecified, defaults to ALL.\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 5;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * High-level actions enabled for the API key policy. An empty list grants no\n * access. Up to 64 unique explicit actions are allowed.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 7;\n */\n actions: PolicyAction[];\n\n /**\n * Whether this policy should be treated as a reusable template.\n *\n * @generated from field: bool is_template = 19;\n */\n isTemplate: boolean;\n};\n\n/**\n * Describes the message auth.v1.ApiPolicySpec.\n * Use `create(ApiPolicySpecSchema)` to create a new message.\n */\nexport const ApiPolicySpecSchema: GenMessage<ApiPolicySpec> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 22);\n\n/**\n * CreateApiPolicyRequest defines a new API key policy template.\n *\n * @generated from message auth.v1.CreateApiPolicyRequest\n */\nexport type CreateApiPolicyRequest = Message<\"auth.v1.CreateApiPolicyRequest\"> & {\n /**\n * Complete mutable policy configuration.\n *\n * @generated from field: auth.v1.ApiPolicySpec policy = 1;\n */\n policy?: ApiPolicySpec | undefined;\n\n /**\n * Optional API key identifier to bind this newly-created policy to\n * atomically. When set, the caller must be allowed to manage the key and the\n * create+assign operation consumes a single fresh step-up proof.\n *\n * @generated from field: string assign_to_key_id = 2;\n */\n assignToKeyId: string;\n};\n\n/**\n * Describes the message auth.v1.CreateApiPolicyRequest.\n * Use `create(CreateApiPolicyRequestSchema)` to create a new message.\n */\nexport const CreateApiPolicyRequestSchema: GenMessage<CreateApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 23);\n\n/**\n * CreateApiPolicyResponse returns the created API key policy.\n *\n * @generated from message auth.v1.CreateApiPolicyResponse\n */\nexport type CreateApiPolicyResponse = Message<\"auth.v1.CreateApiPolicyResponse\"> & {\n /**\n * Created API key policy.\n *\n * @generated from field: auth.v1.ApiPolicyView policy = 1;\n */\n policy?: ApiPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.CreateApiPolicyResponse.\n * Use `create(CreateApiPolicyResponseSchema)` to create a new message.\n */\nexport const CreateApiPolicyResponseSchema: GenMessage<CreateApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 24);\n\n/**\n * UpdateApiPolicyRequest changes selected mutable fields on an existing API\n * key policy.\n *\n * @generated from message auth.v1.UpdateApiPolicyRequest\n */\nexport type UpdateApiPolicyRequest = Message<\"auth.v1.UpdateApiPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Candidate values for fields selected by update_mask.\n *\n * @generated from field: auth.v1.ApiPolicySpec policy = 2;\n */\n policy?: ApiPolicySpec | undefined;\n\n /**\n * Mutable fields to apply. Paths are relative to policy. The mask is required,\n * must be non-empty, and cannot contain \"*\".\n *\n * @generated from field: google.protobuf.FieldMask update_mask = 3;\n */\n updateMask?: FieldMask | undefined;\n\n /**\n * Revision returned by the latest successful read. Stale revisions fail with\n * a conflict before no-op detection.\n *\n * @generated from field: uint64 expected_revision = 4;\n */\n expectedRevision: bigint;\n};\n\n/**\n * Describes the message auth.v1.UpdateApiPolicyRequest.\n * Use `create(UpdateApiPolicyRequestSchema)` to create a new message.\n */\nexport const UpdateApiPolicyRequestSchema: GenMessage<UpdateApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 25);\n\n/**\n * UpdateApiPolicyResponse returns the updated API key policy.\n *\n * @generated from message auth.v1.UpdateApiPolicyResponse\n */\nexport type UpdateApiPolicyResponse = Message<\"auth.v1.UpdateApiPolicyResponse\"> & {\n /**\n * Updated API key policy.\n *\n * @generated from field: auth.v1.ApiPolicyView policy = 1;\n */\n policy?: ApiPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.UpdateApiPolicyResponse.\n * Use `create(UpdateApiPolicyResponseSchema)` to create a new message.\n */\nexport const UpdateApiPolicyResponseSchema: GenMessage<UpdateApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 26);\n\n/**\n * DeleteApiPolicyRequest deletes an API key policy template when it is not in use.\n *\n * @generated from message auth.v1.DeleteApiPolicyRequest\n */\nexport type DeleteApiPolicyRequest = Message<\"auth.v1.DeleteApiPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.DeleteApiPolicyRequest.\n * Use `create(DeleteApiPolicyRequestSchema)` to create a new message.\n */\nexport const DeleteApiPolicyRequestSchema: GenMessage<DeleteApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 27);\n\n/**\n * DeleteApiPolicyResponse is empty when the delete succeeds.\n *\n * @generated from message auth.v1.DeleteApiPolicyResponse\n */\nexport type DeleteApiPolicyResponse = Message<\"auth.v1.DeleteApiPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.DeleteApiPolicyResponse.\n * Use `create(DeleteApiPolicyResponseSchema)` to create a new message.\n */\nexport const DeleteApiPolicyResponseSchema: GenMessage<DeleteApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 28);\n\n/**\n * SetApiKeyPolicyRequest attaches or clears a policy template on an API key.\n *\n * @generated from message auth.v1.SetApiKeyPolicyRequest\n */\nexport type SetApiKeyPolicyRequest = Message<\"auth.v1.SetApiKeyPolicyRequest\"> & {\n /**\n * Opaque API key identifier, formatted as \"ak_\" followed by 32 lowercase hex\n * characters.\n *\n * @generated from field: string key_id = 1;\n */\n keyId: string;\n\n /**\n * Policy template to attach (opaque ID). A value of 0 clears the binding.\n * An API key without an attached policy has no permissions.\n *\n * @generated from field: fixed64 policy_id = 2;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.SetApiKeyPolicyRequest.\n * Use `create(SetApiKeyPolicyRequestSchema)` to create a new message.\n */\nexport const SetApiKeyPolicyRequestSchema: GenMessage<SetApiKeyPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 29);\n\n/**\n * SetApiKeyPolicyResponse is empty when the policy binding succeeds.\n *\n * @generated from message auth.v1.SetApiKeyPolicyResponse\n */\nexport type SetApiKeyPolicyResponse = Message<\"auth.v1.SetApiKeyPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.SetApiKeyPolicyResponse.\n * Use `create(SetApiKeyPolicyResponseSchema)` to create a new message.\n */\nexport const SetApiKeyPolicyResponseSchema: GenMessage<SetApiKeyPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 30);\n\n/**\n * PolicyAction is a high-level permission that can be granted by a policy.\n * Write-style actions also grant the matching read visibility where needed by\n * the product experience.\n *\n * @generated from enum auth.v1.PolicyAction\n */\nexport enum PolicyAction {\n /**\n * No policy action selected. An empty API-key action list grants no access;\n * sub-account policies retain their mandatory read-only actions.\n *\n * @generated from enum value: UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Allow placing and modifying spot orders and triggers, including reading\n * spot orders and trades. Cancellation and pausing remain available as\n * safety actions.\n *\n * @generated from enum value: TRADE_SPOT = 1;\n */\n TRADE_SPOT = 1,\n\n /**\n * Allow internal transfers between sub-accounts or linked Polyester accounts,\n * including reading internal transfer history.\n *\n * @generated from enum value: INTERNAL_TRANSFER = 3;\n */\n INTERNAL_TRANSFER = 3,\n\n /**\n * Allow value to leave Trading through external withdrawals. Destination\n * authorization is enforced separately from this policy.\n *\n * @generated from enum value: EXTERNAL_WITHDRAW = 4;\n */\n EXTERNAL_WITHDRAW = 4,\n\n /**\n * Allow reading balances and equity for a sub-account or API key.\n *\n * @generated from enum value: READ_BALANCES = 5;\n */\n READ_BALANCES = 5,\n\n /**\n * Allow reading spot orders and trades (no write).\n *\n * @generated from enum value: READ_SPOT = 6;\n */\n READ_SPOT = 6,\n\n /**\n * Allow reading internal transfer history.\n *\n * @generated from enum value: READ_INTERNAL_TRANSFERS = 8;\n */\n READ_INTERNAL_TRANSFERS = 8,\n\n /**\n * Allow reading saved, recent, and whitelisted address-book destinations.\n *\n * @generated from enum value: READ_ADDRESS_BOOK = 11;\n */\n READ_ADDRESS_BOOK = 11,\n\n /**\n * Allow creating, updating, deleting, and copying saved destination entries,\n * including reading the address book.\n *\n * @generated from enum value: MANAGE_ADDRESS_BOOK = 12;\n */\n MANAGE_ADDRESS_BOOK = 12,\n}\n\n/**\n * Describes the enum auth.v1.PolicyAction.\n */\nexport const PolicyActionSchema: GenEnum<PolicyAction> = /*@__PURE__*/\n enumDesc(file_auth_v1_policies, 0);\n\n/**\n * PolicyService manages sub-account and API key policy templates and bindings.\n *\n * @generated from service auth.v1.PolicyService\n */\nexport const PolicyService: GenService<{\n /**\n * List sub-account policy templates available to the caller.\n *\n * @generated from rpc auth.v1.PolicyService.ListSubaccountPolicies\n */\n listSubaccountPolicies: {\n methodKind: \"unary\";\n input: typeof ListSubaccountPoliciesRequestSchema;\n output: typeof ListSubaccountPoliciesResponseSchema;\n },\n /**\n * Get a sub-account policy template by id.\n *\n * @generated from rpc auth.v1.PolicyService.GetSubaccountPolicy\n */\n getSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof GetSubaccountPolicyRequestSchema;\n output: typeof GetSubaccountPolicyResponseSchema;\n },\n /**\n * Create a new sub-account policy template (optionally attach to a sub-account).\n *\n * @generated from rpc auth.v1.PolicyService.CreateSubaccountPolicy\n */\n createSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof CreateSubaccountPolicyRequestSchema;\n output: typeof CreateSubaccountPolicyResponseSchema;\n },\n /**\n * Change selected fields on an existing sub-account policy template.\n *\n * @generated from rpc auth.v1.PolicyService.UpdateSubaccountPolicy\n */\n updateSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof UpdateSubaccountPolicyRequestSchema;\n output: typeof UpdateSubaccountPolicyResponseSchema;\n },\n /**\n * Delete a sub-account policy template.\n *\n * @generated from rpc auth.v1.PolicyService.DeleteSubaccountPolicy\n */\n deleteSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof DeleteSubaccountPolicyRequestSchema;\n output: typeof DeleteSubaccountPolicyResponseSchema;\n },\n /**\n * Attach or clear a sub-account policy for a sub-account.\n *\n * @generated from rpc auth.v1.PolicyService.SetSubaccountPolicy\n */\n setSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof SetSubaccountPolicyRequestSchema;\n output: typeof SetSubaccountPolicyResponseSchema;\n },\n /**\n * List API key policy templates available to the caller.\n *\n * @generated from rpc auth.v1.PolicyService.ListApiPolicies\n */\n listApiPolicies: {\n methodKind: \"unary\";\n input: typeof ListApiPoliciesRequestSchema;\n output: typeof ListApiPoliciesResponseSchema;\n },\n /**\n * Get an API key policy template by id.\n *\n * @generated from rpc auth.v1.PolicyService.GetApiPolicy\n */\n getApiPolicy: {\n methodKind: \"unary\";\n input: typeof GetApiPolicyRequestSchema;\n output: typeof GetApiPolicyResponseSchema;\n },\n /**\n * Create a new API key policy template.\n *\n * @generated from rpc auth.v1.PolicyService.CreateApiPolicy\n */\n createApiPolicy: {\n methodKind: \"unary\";\n input: typeof CreateApiPolicyRequestSchema;\n output: typeof CreateApiPolicyResponseSchema;\n },\n /**\n * Change selected fields on an existing API key policy template.\n *\n * @generated from rpc auth.v1.PolicyService.UpdateApiPolicy\n */\n updateApiPolicy: {\n methodKind: \"unary\";\n input: typeof UpdateApiPolicyRequestSchema;\n output: typeof UpdateApiPolicyResponseSchema;\n },\n /**\n * Delete an API key policy template.\n *\n * @generated from rpc auth.v1.PolicyService.DeleteApiPolicy\n */\n deleteApiPolicy: {\n methodKind: \"unary\";\n input: typeof DeleteApiPolicyRequestSchema;\n output: typeof DeleteApiPolicyResponseSchema;\n },\n /**\n * Attach or clear an API key policy for a key.\n *\n * @generated from rpc auth.v1.PolicyService.SetApiKeyPolicy\n */\n setApiKeyPolicy: {\n methodKind: \"unary\";\n input: typeof SetApiKeyPolicyRequestSchema;\n output: typeof SetApiKeyPolicyResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_auth_v1_policies, 0);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,wBACX,uBAAS,g7PAAg7P;CAAC;CAAiC;CAAgC;AAA0B,CAAC;;;;;AAcxhQ,MAAa,oBACX,0BAAY,uBAAuB,CAAC;;;;;;;;AAStC,IAAY,oBAAL,yBAAA,mBAAA;;;;;;CAML,kBAAA,kBAAA,iBAAA,KAAA;;;;;;CAOA,kBAAA,kBAAA,SAAA,KAAA;;;;;;CAOA,kBAAA,kBAAA,e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,0BAAY,uBAAuB,EAAE;;;;;AAoBvC,MAAa,gCACX,0BAAY,uBAAuB,EAAE;;;;;AAoBvC,MAAa,+BACX,0BAAY,uBAAuB,EAAE;;;;;AAcvC,MAAa,gCACX,0BAAY,uBAAuB,EAAE;;;;;AA6BvC,MAAa,+BACX,0BAAY,uBAAuB,EAAE;;;;;AAcvC,MAAa,gCACX,0BAAY,uBAAuB,EAAE;;;;;;;;AASvC,IAAY,eAAL,yBAAA,cAAA;;;;;;;CAOL,aAAA,aAAA,iBAAA,KAAA;;;;;;;;CASA,aAAA,aAAA,gBAAA,KAAA;;;;;;;CAQA,aAAA,aAAA,uBAAA,KAAA;;;;;;;CAQA,aAAA,aAAA,uBAAA,KAAA;;;;;;CAOA,aAAA,aAAA,mBAAA,KAAA;;;;;;CAOA,aAAA,aAAA,eAAA,KAAA;;;;;;CAOA,aAAA,aAAA,6BAAA,KAAA;;;;;;CAOA,aAAA,aAAA,uBAAA,MAAA;;;;;;;CAQA,aAAA,aAAA,yBAAA,MAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,MAAa,qBACX,uBAAS,uBAAuB,CAAC;;;;;;AAOnC,MAAa,gBA0HX,0BAAY,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"policies_pb.js","names":[],"sources":["../../../../src/gen/auth/v1/policies_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file auth/v1/policies.proto (package auth.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { FieldMask, Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_field_mask, file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_polyester_api_options } from \"../../polyester/api/options_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file auth/v1/policies.proto.\n */\nexport const file_auth_v1_policies: GenFile = /*@__PURE__*/\n fileDesc(\"ChZhdXRoL3YxL3BvbGljaWVzLnByb3RvEgdhdXRoLnYxIj8KC01hcmtldFNjb3BlIjAKBVZhbHVlEg8KC1VOU1BFQ0lGSUVEEAASBwoDQUxMEAESDQoJQUxMT1dMSVNUEAIiKQoSU3BvdE1hcmtldFNlbGVjdG9yEhMKCXN5bWJvbF9pZBgBIAEoDUIAIiMKDlNwb3RNYXJrZXRSdWxlEhEKCXN5bWJvbF9pZBgBIAEoDSLvBgoUU3ViYWNjb3VudFBvbGljeVZpZXcSCgoCaWQYASABKAYSDAoEbmFtZRgCIAEoCRITCgtkZXNjcmlwdGlvbhgDIAEoCRItCgxzcG90X21hcmtldHMYBCADKAsyFy5hdXRoLnYxLlNwb3RNYXJrZXRSdWxlEjcKEXNwb3RfbWFya2V0X3Njb3BlGAYgASgOMhouYXV0aC52MS5NYXJrZXRTY29wZS5WYWx1ZUIAEigKB2FjdGlvbnMYCCADKA4yFS5hdXRoLnYxLlBvbGljeUFjdGlvbkIAEhMKC2lzX3RlbXBsYXRlGAogASgIEhoKEnNvdXJjZV90ZW1wbGF0ZV9pZBgLIAEoBhIaChJtYXhfb3JkZXJfbm90aW9uYWwYDSABKAQSFwoPbWF4X29wZW5fb3JkZXJzGA4gASgNEhYKDnRyYWRpbmdfaGFsdGVkGBcgASgIEg4KBmxvY2tlZBgbIAEoCBItCglyZXZpZXdfYXQYHCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCmV4cGlyZXNfYXQYHSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCmNyZWF0ZWRfYXQYFCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYFSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhAKCHJldmlzaW9uGB4gASg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9saWN5UmVzcG9uc2UiABJWCg9DcmVhdGVBcGlQb2xpY3kSHy5hdXRoLnYxLkNyZWF0ZUFwaVBvbGljeVJlcXVlc3QaIC5hdXRoLnYxLkNyZWF0ZUFwaVBvbGljeVJlc3BvbnNlIgASVgoPVXBkYXRlQXBpUG9saWN5Eh8uYXV0aC52MS5VcGRhdGVBcGlQb2xpY3lSZXF1ZXN0GiAuYXV0aC52MS5VcGRhdGVBcGlQb2xpY3lSZXNwb25zZSIAElYKD0RlbGV0ZUFwaVBvbGljeRIfLmF1dGgudjEuRGVsZXRlQXBpUG9saWN5UmVxdWVzdBogLmF1dGgudjEuRGVsZXRlQXBpUG9saWN5UmVzcG9uc2UiABJWCg9TZXRBcGlLZXlQb2xpY3kSHy5hdXRoLnYxLlNldEFwaUtleVBvbGljeVJlcXVlc3QaIC5hdXRoLnYxLlNldEFwaUtleVBvbGljeVJlc3BvbnNlIgBCPFo6Z2l0aHViLmNvbS9GYWJyaWMtTGFicy9wb2x5ZXN0ZXItc2RrLWdvL2dlbi9hdXRoL3YxO2F1dGh2MWIGcHJvdG8z\", [file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_polyester_api_options]);\n\n/**\n * MarketScope describes how a policy applies to spot markets.\n *\n * @generated from message auth.v1.MarketScope\n */\nexport type MarketScope = Message<\"auth.v1.MarketScope\"> & {\n};\n\n/**\n * Describes the message auth.v1.MarketScope.\n * Use `create(MarketScopeSchema)` to create a new message.\n */\nexport const MarketScopeSchema: GenMessage<MarketScope> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 0);\n\n/**\n * Value is the market-level scope:\n * - ALL: no market-level restriction; new listings are automatically allowed.\n * - ALLOWLIST: only the listed markets are allowed.\n *\n * @generated from enum auth.v1.MarketScope.Value\n */\nexport enum MarketScope_Value {\n /**\n * No scope selected. Create and update requests treat this as ALL.\n *\n * @generated from enum value: UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Allow all current and future markets for this policy.\n *\n * @generated from enum value: ALL = 1;\n */\n ALL = 1,\n\n /**\n * Allow only the markets listed on this policy.\n *\n * @generated from enum value: ALLOWLIST = 2;\n */\n ALLOWLIST = 2,\n}\n\n/**\n * Describes the enum auth.v1.MarketScope.Value.\n */\nexport const MarketScope_ValueSchema: GenEnum<MarketScope_Value> = /*@__PURE__*/\n enumDesc(file_auth_v1_policies, 0, 0);\n\n/**\n * SpotMarketSelector identifies an allowed spot market in policy mutations.\n *\n * @generated from message auth.v1.SpotMarketSelector\n */\nexport type SpotMarketSelector = Message<\"auth.v1.SpotMarketSelector\"> & {\n /**\n * Stable numeric pair ID from GetSpotConfig.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n};\n\n/**\n * Describes the message auth.v1.SpotMarketSelector.\n * Use `create(SpotMarketSelectorSchema)` to create a new message.\n */\nexport const SpotMarketSelectorSchema: GenMessage<SpotMarketSelector> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 1);\n\n/**\n * SpotMarketRule describes an allowed spot market in policy views.\n *\n * @generated from message auth.v1.SpotMarketRule\n */\nexport type SpotMarketRule = Message<\"auth.v1.SpotMarketRule\"> & {\n /**\n * Stable numeric pair ID.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n};\n\n/**\n * Describes the message auth.v1.SpotMarketRule.\n * Use `create(SpotMarketRuleSchema)` to create a new message.\n */\nexport const SpotMarketRuleSchema: GenMessage<SpotMarketRule> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 2);\n\n/**\n * SubaccountPolicyView is the public view of a sub-account policy.\n *\n * @generated from message auth.v1.SubaccountPolicyView\n */\nexport type SubaccountPolicyView = Message<\"auth.v1.SubaccountPolicyView\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 id = 1;\n */\n id: bigint;\n\n /**\n * Human-readable policy name.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits.\n *\n * @generated from field: string description = 3;\n */\n description: string;\n\n /**\n * Allowed spot markets for this sub-account.\n *\n * @generated from field: repeated auth.v1.SpotMarketRule spot_markets = 4;\n */\n spotMarkets: SpotMarketRule[];\n\n /**\n * Market-level scope for spot markets. When ALL, spot_markets is returned\n * for display only and is not enforced.\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 6;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * Effective high-level actions enabled for the sub-account. Mandatory\n * read-only actions are always included.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 8;\n */\n actions: PolicyAction[];\n\n /**\n * True if this policy is a reusable template; false if it is a\n * per-sub-account instance.\n *\n * @generated from field: bool is_template = 10;\n */\n isTemplate: boolean;\n\n /**\n * Optional source template this policy was copied from (opaque ID). This is\n * audit metadata only and does not imply live linkage.\n *\n * @generated from field: fixed64 source_template_id = 11;\n */\n sourceTemplateId: bigint;\n\n /**\n * Maximum notional size allowed for any single order on this sub-account,\n * expressed in canonical quote microunits (one unit is 0.000001 USDT).\n * A value of 0 means \"no explicit cap\".\n *\n * @generated from field: uint64 max_order_notional = 13;\n */\n maxOrderNotional: bigint;\n\n /**\n * Maximum number of resting orders allowed on this sub-account at any time.\n * A value of 0 means \"no explicit cap\".\n *\n * @generated from field: uint32 max_open_orders = 14;\n */\n maxOpenOrders: number;\n\n /**\n * When true, new orders and exposure-increasing order or trigger changes are\n * rejected regardless of other settings. Existing orders and triggers may\n * still be canceled or paused by an otherwise authorized caller.\n *\n * @generated from field: bool trading_halted = 23;\n */\n tradingHalted: boolean;\n\n /**\n * When true, this policy is write-protected and requires an elevated approval\n * flow to modify it.\n *\n * @generated from field: bool locked = 27;\n */\n locked: boolean;\n\n /**\n * Optional review time in UTC. This is governance metadata and does not\n * automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp review_at = 28;\n */\n reviewAt?: Timestamp | undefined;\n\n /**\n * Optional expiry time in UTC. This is governance metadata and does not\n * automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 29;\n */\n expiresAt?: Timestamp | undefined;\n\n /**\n * Creation time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 20;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Last update time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp updated_at = 21;\n */\n updatedAt?: Timestamp | undefined;\n\n /**\n * Monotonic resource revision used for conditional updates.\n *\n * @generated from field: uint64 revision = 30;\n */\n revision: bigint;\n};\n\n/**\n * Describes the message auth.v1.SubaccountPolicyView.\n * Use `create(SubaccountPolicyViewSchema)` to create a new message.\n */\nexport const SubaccountPolicyViewSchema: GenMessage<SubaccountPolicyView> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 3);\n\n/**\n * ListSubaccountPoliciesRequest lists the finite set of sub-account policies\n * visible in the requested account scope. Results are sorted by ascending\n * policy ID and are not paginated.\n *\n * @generated from message auth.v1.ListSubaccountPoliciesRequest\n */\nexport type ListSubaccountPoliciesRequest = Message<\"auth.v1.ListSubaccountPoliciesRequest\"> & {\n /**\n * Optional sub-account context. When provided, a current member may read the\n * policy attached to that sub-account; the owner retains visibility of all\n * policies owned by their root account. When omitted, only policies owned by\n * the caller's root account are returned.\n *\n * @generated from field: optional fixed64 subaccount_id = 1;\n */\n subaccountId?: bigint | undefined;\n};\n\n/**\n * Describes the message auth.v1.ListSubaccountPoliciesRequest.\n * Use `create(ListSubaccountPoliciesRequestSchema)` to create a new message.\n */\nexport const ListSubaccountPoliciesRequestSchema: GenMessage<ListSubaccountPoliciesRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 4);\n\n/**\n * ListSubaccountPoliciesResponse contains sub-account policy templates sorted\n * by ascending policy ID.\n *\n * @generated from message auth.v1.ListSubaccountPoliciesResponse\n */\nexport type ListSubaccountPoliciesResponse = Message<\"auth.v1.ListSubaccountPoliciesResponse\"> & {\n /**\n * Sub-account policy templates visible to the caller.\n *\n * @generated from field: repeated auth.v1.SubaccountPolicyView policies = 1;\n */\n policies: SubaccountPolicyView[];\n};\n\n/**\n * Describes the message auth.v1.ListSubaccountPoliciesResponse.\n * Use `create(ListSubaccountPoliciesResponseSchema)` to create a new message.\n */\nexport const ListSubaccountPoliciesResponseSchema: GenMessage<ListSubaccountPoliciesResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 5);\n\n/**\n * GetSubaccountPolicyRequest fetches one sub-account policy template by ID.\n *\n * @generated from message auth.v1.GetSubaccountPolicyRequest\n */\nexport type GetSubaccountPolicyRequest = Message<\"auth.v1.GetSubaccountPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Optional sub-account context. When provided, a current member may read the\n * policy attached to that sub-account; the owner may also read another policy\n * owned by their root account. When omitted, the policy must be owned by the\n * caller's root account.\n *\n * @generated from field: optional fixed64 subaccount_id = 2;\n */\n subaccountId?: bigint | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetSubaccountPolicyRequest.\n * Use `create(GetSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const GetSubaccountPolicyRequestSchema: GenMessage<GetSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 6);\n\n/**\n * GetSubaccountPolicyResponse returns the requested sub-account policy.\n *\n * @generated from message auth.v1.GetSubaccountPolicyResponse\n */\nexport type GetSubaccountPolicyResponse = Message<\"auth.v1.GetSubaccountPolicyResponse\"> & {\n /**\n * Matching sub-account policy.\n *\n * @generated from field: auth.v1.SubaccountPolicyView policy = 1;\n */\n policy?: SubaccountPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetSubaccountPolicyResponse.\n * Use `create(GetSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const GetSubaccountPolicyResponseSchema: GenMessage<GetSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 7);\n\n/**\n * SubaccountPolicySpec contains the mutable configuration of a sub-account policy.\n *\n * @generated from message auth.v1.SubaccountPolicySpec\n */\nexport type SubaccountPolicySpec = Message<\"auth.v1.SubaccountPolicySpec\"> & {\n /**\n * Human-readable policy name. Create requires a non-empty value; update\n * validates it after merging fields selected by update_mask.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits. Maximum 256 characters.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * Allowed spot markets for this policy.\n *\n * @generated from field: repeated auth.v1.SpotMarketSelector spot_markets = 3;\n */\n spotMarkets: SpotMarketSelector[];\n\n /**\n * Market-level scope for spot markets. When unspecified, defaults to ALL.\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 5;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * High-level actions enabled for the sub-account policy. Mandatory read-only\n * actions are included when omitted. Up to 64 unique explicit actions are\n * allowed.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 7;\n */\n actions: PolicyAction[];\n\n /**\n * Maximum notional size for any single order on this sub-account, expressed\n * in canonical quote microunits (one unit is 0.000001 USDT). A value of 0\n * means no explicit cap.\n *\n * @generated from field: uint64 max_order_notional = 13;\n */\n maxOrderNotional: bigint;\n\n /**\n * Maximum number of resting orders allowed on this sub-account at any time.\n * A value of 0 means no explicit cap.\n *\n * @generated from field: uint32 max_open_orders = 14;\n */\n maxOpenOrders: number;\n\n /**\n * When true, new orders and exposure-increasing order or trigger changes are\n * rejected regardless of other settings. Existing orders and triggers may\n * still be canceled or paused by an otherwise authorized caller.\n *\n * @generated from field: bool trading_halted = 21;\n */\n tradingHalted: boolean;\n\n /**\n * When true, the policy is write-protected and requires an elevated mutation path.\n *\n * @generated from field: bool locked = 25;\n */\n locked: boolean;\n\n /**\n * Optional review time in UTC. This does not automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp review_at = 26;\n */\n reviewAt?: Timestamp | undefined;\n\n /**\n * Optional expiry time in UTC. This does not automatically disable the policy.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 27;\n */\n expiresAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message auth.v1.SubaccountPolicySpec.\n * Use `create(SubaccountPolicySpecSchema)` to create a new message.\n */\nexport const SubaccountPolicySpecSchema: GenMessage<SubaccountPolicySpec> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 8);\n\n/**\n * CreateSubaccountPolicyRequest defines a new sub-account policy template, with\n * an optional attach step for one target sub-account.\n *\n * @generated from message auth.v1.CreateSubaccountPolicyRequest\n */\nexport type CreateSubaccountPolicyRequest = Message<\"auth.v1.CreateSubaccountPolicyRequest\"> & {\n /**\n * Complete mutable policy configuration.\n *\n * @generated from field: auth.v1.SubaccountPolicySpec policy = 1;\n */\n policy?: SubaccountPolicySpec | undefined;\n\n /**\n * Optional target sub-account to attach atomically after creation.\n *\n * @generated from field: optional fixed64 subaccount_id = 2;\n */\n subaccountId?: bigint | undefined;\n};\n\n/**\n * Describes the message auth.v1.CreateSubaccountPolicyRequest.\n * Use `create(CreateSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const CreateSubaccountPolicyRequestSchema: GenMessage<CreateSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 9);\n\n/**\n * CreateSubaccountPolicyResponse returns the created sub-account policy.\n *\n * @generated from message auth.v1.CreateSubaccountPolicyResponse\n */\nexport type CreateSubaccountPolicyResponse = Message<\"auth.v1.CreateSubaccountPolicyResponse\"> & {\n /**\n * Created sub-account policy.\n *\n * @generated from field: auth.v1.SubaccountPolicyView policy = 1;\n */\n policy?: SubaccountPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.CreateSubaccountPolicyResponse.\n * Use `create(CreateSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const CreateSubaccountPolicyResponseSchema: GenMessage<CreateSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 10);\n\n/**\n * UpdateSubaccountPolicyRequest changes selected mutable fields on an existing\n * sub-account policy.\n *\n * @generated from message auth.v1.UpdateSubaccountPolicyRequest\n */\nexport type UpdateSubaccountPolicyRequest = Message<\"auth.v1.UpdateSubaccountPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Candidate values for fields selected by update_mask.\n *\n * @generated from field: auth.v1.SubaccountPolicySpec policy = 2;\n */\n policy?: SubaccountPolicySpec | undefined;\n\n /**\n * Mutable fields to apply. Paths are relative to policy. The mask is required,\n * must be non-empty, and cannot contain \"*\".\n *\n * @generated from field: google.protobuf.FieldMask update_mask = 3;\n */\n updateMask?: FieldMask | undefined;\n\n /**\n * Revision returned by the latest successful read. Stale revisions fail with\n * a conflict before no-op detection.\n *\n * @generated from field: uint64 expected_revision = 4;\n */\n expectedRevision: bigint;\n};\n\n/**\n * Describes the message auth.v1.UpdateSubaccountPolicyRequest.\n * Use `create(UpdateSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const UpdateSubaccountPolicyRequestSchema: GenMessage<UpdateSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 11);\n\n/**\n * UpdateSubaccountPolicyResponse returns the updated sub-account policy.\n *\n * @generated from message auth.v1.UpdateSubaccountPolicyResponse\n */\nexport type UpdateSubaccountPolicyResponse = Message<\"auth.v1.UpdateSubaccountPolicyResponse\"> & {\n /**\n * Updated sub-account policy.\n *\n * @generated from field: auth.v1.SubaccountPolicyView policy = 1;\n */\n policy?: SubaccountPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.UpdateSubaccountPolicyResponse.\n * Use `create(UpdateSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const UpdateSubaccountPolicyResponseSchema: GenMessage<UpdateSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 12);\n\n/**\n * DeleteSubaccountPolicyRequest deletes a sub-account policy template when it\n * is not in use.\n *\n * @generated from message auth.v1.DeleteSubaccountPolicyRequest\n */\nexport type DeleteSubaccountPolicyRequest = Message<\"auth.v1.DeleteSubaccountPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.DeleteSubaccountPolicyRequest.\n * Use `create(DeleteSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const DeleteSubaccountPolicyRequestSchema: GenMessage<DeleteSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 13);\n\n/**\n * DeleteSubaccountPolicyResponse is empty when the delete succeeds.\n *\n * @generated from message auth.v1.DeleteSubaccountPolicyResponse\n */\nexport type DeleteSubaccountPolicyResponse = Message<\"auth.v1.DeleteSubaccountPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.DeleteSubaccountPolicyResponse.\n * Use `create(DeleteSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const DeleteSubaccountPolicyResponseSchema: GenMessage<DeleteSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 14);\n\n/**\n * SetSubaccountPolicyRequest attaches or clears a policy template on a\n * sub-account.\n *\n * @generated from message auth.v1.SetSubaccountPolicyRequest\n */\nexport type SetSubaccountPolicyRequest = Message<\"auth.v1.SetSubaccountPolicyRequest\"> & {\n /**\n * Sub-account identifier (opaque ID).\n *\n * @generated from field: fixed64 subaccount_id = 1;\n */\n subaccountId: bigint;\n\n /**\n * Policy template to attach (opaque ID). A value of 0 clears the explicit\n * binding and restores the system Read Only policy.\n *\n * @generated from field: fixed64 policy_id = 2;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.SetSubaccountPolicyRequest.\n * Use `create(SetSubaccountPolicyRequestSchema)` to create a new message.\n */\nexport const SetSubaccountPolicyRequestSchema: GenMessage<SetSubaccountPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 15);\n\n/**\n * SetSubaccountPolicyResponse is empty when the policy binding succeeds.\n *\n * @generated from message auth.v1.SetSubaccountPolicyResponse\n */\nexport type SetSubaccountPolicyResponse = Message<\"auth.v1.SetSubaccountPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.SetSubaccountPolicyResponse.\n * Use `create(SetSubaccountPolicyResponseSchema)` to create a new message.\n */\nexport const SetSubaccountPolicyResponseSchema: GenMessage<SetSubaccountPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 16);\n\n/**\n * ApiPolicyView is the public view of an API key policy template. Its action\n * and spot-market floor cannot exceed an attached sub-account policy.\n *\n * @generated from message auth.v1.ApiPolicyView\n */\nexport type ApiPolicyView = Message<\"auth.v1.ApiPolicyView\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 id = 1;\n */\n id: bigint;\n\n /**\n * Human-readable policy name.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits.\n *\n * @generated from field: string description = 3;\n */\n description: string;\n\n /**\n * Allowed spot markets for this API key policy.\n *\n * @generated from field: repeated auth.v1.SpotMarketRule spot_markets = 4;\n */\n spotMarkets: SpotMarketRule[];\n\n /**\n * High-level actions enabled for this API key. Up to 64 unique explicit\n * actions may be returned.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 6;\n */\n actions: PolicyAction[];\n\n /**\n * Market-level scope for spot markets. When ALL, spot_markets is returned\n * for display only and is not enforced.\n *\n * --- Template / lifecycle metadata ---\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 7;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * When true, this policy is intended to be reused as a template across\n * multiple API keys. When false, it represents a single-key instance.\n *\n * @generated from field: bool is_template = 19;\n */\n isTemplate: boolean;\n\n /**\n * Optional source template this policy was copied from (opaque ID). This is\n * audit metadata only and does not imply live linkage.\n *\n * @generated from field: fixed64 source_template_id = 20;\n */\n sourceTemplateId: bigint;\n\n /**\n * Creation time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 21;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Last update time in UTC.\n *\n * @generated from field: google.protobuf.Timestamp updated_at = 22;\n */\n updatedAt?: Timestamp | undefined;\n\n /**\n * Monotonic resource revision used for conditional updates.\n *\n * @generated from field: uint64 revision = 23;\n */\n revision: bigint;\n};\n\n/**\n * Describes the message auth.v1.ApiPolicyView.\n * Use `create(ApiPolicyViewSchema)` to create a new message.\n */\nexport const ApiPolicyViewSchema: GenMessage<ApiPolicyView> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 17);\n\n/**\n * ListApiPoliciesRequest lists the finite set of API key policies visible in\n * the requested account scope. Results are sorted by ascending policy ID and\n * are not paginated.\n *\n * @generated from message auth.v1.ListApiPoliciesRequest\n */\nexport type ListApiPoliciesRequest = Message<\"auth.v1.ListApiPoliciesRequest\"> & {\n /**\n * Optional API key context for delegated administration. When omitted, only\n * policies owned by the caller's root account are returned.\n *\n * @generated from field: optional string key_id = 1;\n */\n keyId?: string | undefined;\n};\n\n/**\n * Describes the message auth.v1.ListApiPoliciesRequest.\n * Use `create(ListApiPoliciesRequestSchema)` to create a new message.\n */\nexport const ListApiPoliciesRequestSchema: GenMessage<ListApiPoliciesRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 18);\n\n/**\n * ListApiPoliciesResponse contains API key policy templates sorted by ascending\n * policy ID.\n *\n * @generated from message auth.v1.ListApiPoliciesResponse\n */\nexport type ListApiPoliciesResponse = Message<\"auth.v1.ListApiPoliciesResponse\"> & {\n /**\n * API key policy templates visible to the caller.\n *\n * @generated from field: repeated auth.v1.ApiPolicyView policies = 1;\n */\n policies: ApiPolicyView[];\n};\n\n/**\n * Describes the message auth.v1.ListApiPoliciesResponse.\n * Use `create(ListApiPoliciesResponseSchema)` to create a new message.\n */\nexport const ListApiPoliciesResponseSchema: GenMessage<ListApiPoliciesResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 19);\n\n/**\n * GetApiPolicyRequest fetches one API key policy template by ID.\n *\n * @generated from message auth.v1.GetApiPolicyRequest\n */\nexport type GetApiPolicyRequest = Message<\"auth.v1.GetApiPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Optional API key context for delegated administration. When omitted, the\n * policy must be owned by the caller's root account.\n *\n * @generated from field: optional string key_id = 2;\n */\n keyId?: string | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetApiPolicyRequest.\n * Use `create(GetApiPolicyRequestSchema)` to create a new message.\n */\nexport const GetApiPolicyRequestSchema: GenMessage<GetApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 20);\n\n/**\n * GetApiPolicyResponse returns the requested API key policy.\n *\n * @generated from message auth.v1.GetApiPolicyResponse\n */\nexport type GetApiPolicyResponse = Message<\"auth.v1.GetApiPolicyResponse\"> & {\n /**\n * Matching API key policy.\n *\n * @generated from field: auth.v1.ApiPolicyView policy = 1;\n */\n policy?: ApiPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetApiPolicyResponse.\n * Use `create(GetApiPolicyResponseSchema)` to create a new message.\n */\nexport const GetApiPolicyResponseSchema: GenMessage<GetApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 21);\n\n/**\n * ApiPolicySpec contains the mutable configuration of an API key policy.\n *\n * @generated from message auth.v1.ApiPolicySpec\n */\nexport type ApiPolicySpec = Message<\"auth.v1.ApiPolicySpec\"> & {\n /**\n * Human-readable policy name. Create requires a non-empty value; update\n * validates it after merging fields selected by update_mask.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * Optional policy description for dashboards and audits. Maximum 256 characters.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * Allowed spot markets for this API key policy.\n *\n * @generated from field: repeated auth.v1.SpotMarketSelector spot_markets = 3;\n */\n spotMarkets: SpotMarketSelector[];\n\n /**\n * Market-level scope for spot markets. When unspecified, defaults to ALL.\n *\n * @generated from field: auth.v1.MarketScope.Value spot_market_scope = 5;\n */\n spotMarketScope: MarketScope_Value;\n\n /**\n * High-level actions enabled for the API key policy. An empty list grants no\n * access. Up to 64 unique explicit actions are allowed.\n *\n * @generated from field: repeated auth.v1.PolicyAction actions = 7;\n */\n actions: PolicyAction[];\n\n /**\n * Whether this policy should be treated as a reusable template.\n *\n * @generated from field: bool is_template = 19;\n */\n isTemplate: boolean;\n};\n\n/**\n * Describes the message auth.v1.ApiPolicySpec.\n * Use `create(ApiPolicySpecSchema)` to create a new message.\n */\nexport const ApiPolicySpecSchema: GenMessage<ApiPolicySpec> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 22);\n\n/**\n * CreateApiPolicyRequest defines a new API key policy template.\n *\n * @generated from message auth.v1.CreateApiPolicyRequest\n */\nexport type CreateApiPolicyRequest = Message<\"auth.v1.CreateApiPolicyRequest\"> & {\n /**\n * Complete mutable policy configuration.\n *\n * @generated from field: auth.v1.ApiPolicySpec policy = 1;\n */\n policy?: ApiPolicySpec | undefined;\n\n /**\n * Optional API key identifier to bind this newly-created policy to\n * atomically. When set, the caller must be allowed to manage the key and the\n * create+assign operation consumes a single fresh step-up proof.\n *\n * @generated from field: string assign_to_key_id = 2;\n */\n assignToKeyId: string;\n};\n\n/**\n * Describes the message auth.v1.CreateApiPolicyRequest.\n * Use `create(CreateApiPolicyRequestSchema)` to create a new message.\n */\nexport const CreateApiPolicyRequestSchema: GenMessage<CreateApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 23);\n\n/**\n * CreateApiPolicyResponse returns the created API key policy.\n *\n * @generated from message auth.v1.CreateApiPolicyResponse\n */\nexport type CreateApiPolicyResponse = Message<\"auth.v1.CreateApiPolicyResponse\"> & {\n /**\n * Created API key policy.\n *\n * @generated from field: auth.v1.ApiPolicyView policy = 1;\n */\n policy?: ApiPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.CreateApiPolicyResponse.\n * Use `create(CreateApiPolicyResponseSchema)` to create a new message.\n */\nexport const CreateApiPolicyResponseSchema: GenMessage<CreateApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 24);\n\n/**\n * UpdateApiPolicyRequest changes selected mutable fields on an existing API\n * key policy.\n *\n * @generated from message auth.v1.UpdateApiPolicyRequest\n */\nexport type UpdateApiPolicyRequest = Message<\"auth.v1.UpdateApiPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n\n /**\n * Candidate values for fields selected by update_mask.\n *\n * @generated from field: auth.v1.ApiPolicySpec policy = 2;\n */\n policy?: ApiPolicySpec | undefined;\n\n /**\n * Mutable fields to apply. Paths are relative to policy. The mask is required,\n * must be non-empty, and cannot contain \"*\".\n *\n * @generated from field: google.protobuf.FieldMask update_mask = 3;\n */\n updateMask?: FieldMask | undefined;\n\n /**\n * Revision returned by the latest successful read. Stale revisions fail with\n * a conflict before no-op detection.\n *\n * @generated from field: uint64 expected_revision = 4;\n */\n expectedRevision: bigint;\n};\n\n/**\n * Describes the message auth.v1.UpdateApiPolicyRequest.\n * Use `create(UpdateApiPolicyRequestSchema)` to create a new message.\n */\nexport const UpdateApiPolicyRequestSchema: GenMessage<UpdateApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 25);\n\n/**\n * UpdateApiPolicyResponse returns the updated API key policy.\n *\n * @generated from message auth.v1.UpdateApiPolicyResponse\n */\nexport type UpdateApiPolicyResponse = Message<\"auth.v1.UpdateApiPolicyResponse\"> & {\n /**\n * Updated API key policy.\n *\n * @generated from field: auth.v1.ApiPolicyView policy = 1;\n */\n policy?: ApiPolicyView | undefined;\n};\n\n/**\n * Describes the message auth.v1.UpdateApiPolicyResponse.\n * Use `create(UpdateApiPolicyResponseSchema)` to create a new message.\n */\nexport const UpdateApiPolicyResponseSchema: GenMessage<UpdateApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 26);\n\n/**\n * DeleteApiPolicyRequest deletes an API key policy template when it is not in use.\n *\n * @generated from message auth.v1.DeleteApiPolicyRequest\n */\nexport type DeleteApiPolicyRequest = Message<\"auth.v1.DeleteApiPolicyRequest\"> & {\n /**\n * Policy identifier (opaque ID).\n *\n * @generated from field: fixed64 policy_id = 1;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.DeleteApiPolicyRequest.\n * Use `create(DeleteApiPolicyRequestSchema)` to create a new message.\n */\nexport const DeleteApiPolicyRequestSchema: GenMessage<DeleteApiPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 27);\n\n/**\n * DeleteApiPolicyResponse is empty when the delete succeeds.\n *\n * @generated from message auth.v1.DeleteApiPolicyResponse\n */\nexport type DeleteApiPolicyResponse = Message<\"auth.v1.DeleteApiPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.DeleteApiPolicyResponse.\n * Use `create(DeleteApiPolicyResponseSchema)` to create a new message.\n */\nexport const DeleteApiPolicyResponseSchema: GenMessage<DeleteApiPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 28);\n\n/**\n * SetApiKeyPolicyRequest attaches or clears a policy template on an API key.\n *\n * @generated from message auth.v1.SetApiKeyPolicyRequest\n */\nexport type SetApiKeyPolicyRequest = Message<\"auth.v1.SetApiKeyPolicyRequest\"> & {\n /**\n * Opaque API key identifier, formatted as \"ak_\" followed by 32 lowercase hex\n * characters.\n *\n * @generated from field: string key_id = 1;\n */\n keyId: string;\n\n /**\n * Policy template to attach (opaque ID). A value of 0 clears the binding.\n * An API key without an attached policy has no permissions.\n *\n * @generated from field: fixed64 policy_id = 2;\n */\n policyId: bigint;\n};\n\n/**\n * Describes the message auth.v1.SetApiKeyPolicyRequest.\n * Use `create(SetApiKeyPolicyRequestSchema)` to create a new message.\n */\nexport const SetApiKeyPolicyRequestSchema: GenMessage<SetApiKeyPolicyRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 29);\n\n/**\n * SetApiKeyPolicyResponse is empty when the policy binding succeeds.\n *\n * @generated from message auth.v1.SetApiKeyPolicyResponse\n */\nexport type SetApiKeyPolicyResponse = Message<\"auth.v1.SetApiKeyPolicyResponse\"> & {\n};\n\n/**\n * Describes the message auth.v1.SetApiKeyPolicyResponse.\n * Use `create(SetApiKeyPolicyResponseSchema)` to create a new message.\n */\nexport const SetApiKeyPolicyResponseSchema: GenMessage<SetApiKeyPolicyResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_policies, 30);\n\n/**\n * PolicyAction is a high-level permission that can be granted by a policy.\n * Write-style actions also grant the matching read visibility where needed by\n * the product experience.\n *\n * @generated from enum auth.v1.PolicyAction\n */\nexport enum PolicyAction {\n /**\n * No policy action selected. An empty API-key action list grants no access;\n * sub-account policies retain their mandatory read-only actions.\n *\n * @generated from enum value: UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Allow all spot order mutations: create, modify, replace, cancel, batch\n * operations, live cancel-all, and arming or disabling cancel-all-after.\n * Includes reading spot orders and trades and placing or modifying triggers.\n * Authorized cancellation remains available when trading activity is disabled;\n * this does not grant mutation access to a read-only API key.\n *\n * @generated from enum value: TRADE_SPOT = 1;\n */\n TRADE_SPOT = 1,\n\n /**\n * Allow internal transfers between sub-accounts or linked Polyester accounts,\n * including reading internal transfer history.\n *\n * @generated from enum value: INTERNAL_TRANSFER = 3;\n */\n INTERNAL_TRANSFER = 3,\n\n /**\n * Allow value to leave Trading through external withdrawals. Destination\n * authorization is enforced separately from this policy.\n *\n * @generated from enum value: EXTERNAL_WITHDRAW = 4;\n */\n EXTERNAL_WITHDRAW = 4,\n\n /**\n * Allow reading balances and equity for a sub-account or API key.\n *\n * @generated from enum value: READ_BALANCES = 5;\n */\n READ_BALANCES = 5,\n\n /**\n * Allow reading spot orders and trades, subscriptions, and cancel-all dry-run.\n * Strictly non-mutating: cancellation and cancel-all-after changes require TRADE_SPOT.\n *\n * @generated from enum value: READ_SPOT = 6;\n */\n READ_SPOT = 6,\n\n /**\n * Allow reading internal transfer history.\n *\n * @generated from enum value: READ_INTERNAL_TRANSFERS = 8;\n */\n READ_INTERNAL_TRANSFERS = 8,\n\n /**\n * Allow reading saved, recent, and whitelisted address-book destinations.\n *\n * @generated from enum value: READ_ADDRESS_BOOK = 11;\n */\n READ_ADDRESS_BOOK = 11,\n\n /**\n * Allow creating, updating, deleting, and copying saved destination entries,\n * including reading the address book.\n *\n * @generated from enum value: MANAGE_ADDRESS_BOOK = 12;\n */\n MANAGE_ADDRESS_BOOK = 12,\n}\n\n/**\n * Describes the enum auth.v1.PolicyAction.\n */\nexport const PolicyActionSchema: GenEnum<PolicyAction> = /*@__PURE__*/\n enumDesc(file_auth_v1_policies, 0);\n\n/**\n * PolicyService manages sub-account and API key policy templates and bindings.\n *\n * @generated from service auth.v1.PolicyService\n */\nexport const PolicyService: GenService<{\n /**\n * List sub-account policy templates available to the caller.\n *\n * @generated from rpc auth.v1.PolicyService.ListSubaccountPolicies\n */\n listSubaccountPolicies: {\n methodKind: \"unary\";\n input: typeof ListSubaccountPoliciesRequestSchema;\n output: typeof ListSubaccountPoliciesResponseSchema;\n },\n /**\n * Get a sub-account policy template by id.\n *\n * @generated from rpc auth.v1.PolicyService.GetSubaccountPolicy\n */\n getSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof GetSubaccountPolicyRequestSchema;\n output: typeof GetSubaccountPolicyResponseSchema;\n },\n /**\n * Create a new sub-account policy template (optionally attach to a sub-account).\n *\n * @generated from rpc auth.v1.PolicyService.CreateSubaccountPolicy\n */\n createSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof CreateSubaccountPolicyRequestSchema;\n output: typeof CreateSubaccountPolicyResponseSchema;\n },\n /**\n * Change selected fields on an existing sub-account policy template.\n *\n * @generated from rpc auth.v1.PolicyService.UpdateSubaccountPolicy\n */\n updateSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof UpdateSubaccountPolicyRequestSchema;\n output: typeof UpdateSubaccountPolicyResponseSchema;\n },\n /**\n * Delete a sub-account policy template.\n *\n * @generated from rpc auth.v1.PolicyService.DeleteSubaccountPolicy\n */\n deleteSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof DeleteSubaccountPolicyRequestSchema;\n output: typeof DeleteSubaccountPolicyResponseSchema;\n },\n /**\n * Attach or clear a sub-account policy for a sub-account.\n *\n * @generated from rpc auth.v1.PolicyService.SetSubaccountPolicy\n */\n setSubaccountPolicy: {\n methodKind: \"unary\";\n input: typeof SetSubaccountPolicyRequestSchema;\n output: typeof SetSubaccountPolicyResponseSchema;\n },\n /**\n * List API key policy templates available to the caller.\n *\n * @generated from rpc auth.v1.PolicyService.ListApiPolicies\n */\n listApiPolicies: {\n methodKind: \"unary\";\n input: typeof ListApiPoliciesRequestSchema;\n output: typeof ListApiPoliciesResponseSchema;\n },\n /**\n * Get an API key policy template by id.\n *\n * @generated from rpc auth.v1.PolicyService.GetApiPolicy\n */\n getApiPolicy: {\n methodKind: \"unary\";\n input: typeof GetApiPolicyRequestSchema;\n output: typeof GetApiPolicyResponseSchema;\n },\n /**\n * Create a new API key policy template.\n *\n * @generated from rpc auth.v1.PolicyService.CreateApiPolicy\n */\n createApiPolicy: {\n methodKind: \"unary\";\n input: typeof CreateApiPolicyRequestSchema;\n output: typeof CreateApiPolicyResponseSchema;\n },\n /**\n * Change selected fields on an existing API key policy template.\n *\n * @generated from rpc auth.v1.PolicyService.UpdateApiPolicy\n */\n updateApiPolicy: {\n methodKind: \"unary\";\n input: typeof UpdateApiPolicyRequestSchema;\n output: typeof UpdateApiPolicyResponseSchema;\n },\n /**\n * Delete an API key policy template.\n *\n * @generated from rpc auth.v1.PolicyService.DeleteApiPolicy\n */\n deleteApiPolicy: {\n methodKind: \"unary\";\n input: typeof DeleteApiPolicyRequestSchema;\n output: typeof DeleteApiPolicyResponseSchema;\n },\n /**\n * Attach or clear an API key policy for a key.\n *\n * @generated from rpc auth.v1.PolicyService.SetApiKeyPolicy\n */\n setApiKeyPolicy: {\n methodKind: \"unary\";\n input: typeof SetApiKeyPolicyRequestSchema;\n output: typeof SetApiKeyPolicyResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_auth_v1_policies, 0);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,wBACX,uBAAS,g7PAAg7P;CAAC;CAAiC;CAAgC;AAA0B,CAAC;;;;;AAcxhQ,MAAa,oBACX,0BAAY,uBAAuB,CAAC;;;;;;;;AAStC,IAAY,oBAAL,yBAAA,mBAAA;;;;;;CAML,kBAAA,kBAAA,iBAAA,KAAA;;;;;;CAOA,kBAAA,kBAAA,SAAA,KAAA;;;;;;CAOA,kBAAA,kBAAA,eAAA,KAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,MAAa,0BACX,uBAAS,uBAAuB,GAAG,CAAC;;;;;AAoBtC,MAAa,2BACX,0BAAY,uBAAuB,CAAC;;;;;AAoBtC,MAAa,uBACX,0BAAY,uBAAuB,CAAC;;;;;AAgJtC,MAAa,6BACX,0BAAY,uBAAuB,CAAC;;;;;AAyBtC,MAAa,sCACX,0BAAY,uBAAuB,CAAC;;;;;AAqBtC,MAAa,uCACX,0BAAY,uBAAuB,CAAC;;;;;AA8BtC,MAAa,mCACX,0BAAY,uBAAuB,CAAC;;;;;AAoBtC,MAAa,oCACX,0BAAY,uBAAuB,CAAC;;;;;AAkGtC,MAAa,6BACX,0BAAY,uBAAuB,CAAC;;;;;AA4BtC,MAAa,sCACX,0BAAY,uBAAuB,CAAC;;;;;AAoBtC,MAAa,uCACX,0BAAY,uBAAuB,EAAE;;;;;AA4CvC,MAAa,sCACX,0BAAY,uBAAuB,EAAE;;;;;AAoBvC,MAAa,uCACX,0BAAY,uBAAuB,EAAE;;;;;AAqBvC,MAAa,sCACX,0BAAY,uBAAuB,EAAE;;;;;AAcvC,MAAa,uCACX,0BAA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