{"version":3,"file":"queue-id.mjs","names":[],"sources":["../../src/predict/queue-id.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n// A leaf module with no SDK imports, so `/sessions` can derive queue IDs without pulling the\n// `/predict` module graph in.\nimport { bcs } from '@mysten/sui/bcs';\nimport { deriveObjectID } from '@mysten/sui/utils';\n\n/**\n * The ID of `expiryMarketId`'s `MarketQueue` under the queue registry `registryId`, whether or not\n * the queue exists yet: Sui's `derived_object::derive_address(registry_id, expiry_market_id)`, as\n * `queue::queue_id` computes it on chain. The parent is the order-flow package's `QueueRegistry`,\n * not its `OrderDesk`. The key is the market's `0x2::object::ID`, whose BCS is the bare 32-byte\n * address. Each market has exactly one queue, created once by the permissionless\n * `queue::create_and_share`.\n */\nexport function deriveQueueId(registryId: string, expiryMarketId: string): string {\n\treturn deriveObjectID(\n\t\tregistryId,\n\t\t'0x2::object::ID',\n\t\tbcs.Address.serialize(expiryMarketId).toBytes(),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAgB,cAAc,YAAoB,gBAAgC;AACjF,QAAO,eACN,YACA,mBACA,IAAI,QAAQ,UAAU,eAAe,CAAC,SAAS,CAC/C"}