{"version":3,"file":"deep_price.mjs","names":[],"sources":["../../../src/contracts/deepbook/deep_price.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * DEEP price module. This module maintains the conversion rate between DEEP and\n * the base and quote assets.\n */\n\nimport { MoveStruct, normalizeMoveArguments } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nconst $moduleName = '@deepbook/core::deep_price';\nexport const Price = new MoveStruct({\n\tname: `${$moduleName}::Price`,\n\tfields: {\n\t\tconversion_rate: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const PriceAdded = new MoveStruct({\n\tname: `${$moduleName}::PriceAdded`,\n\tfields: {\n\t\tconversion_rate: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t\tis_base_conversion: bcs.bool(),\n\t\treference_pool: bcs.Address,\n\t\ttarget_pool: bcs.Address,\n\t},\n});\nexport const DeepPrice = new MoveStruct({\n\tname: `${$moduleName}::DeepPrice`,\n\tfields: {\n\t\tbase_prices: bcs.vector(Price),\n\t\tcumulative_base: bcs.u64(),\n\t\tquote_prices: bcs.vector(Price),\n\t\tcumulative_quote: bcs.u64(),\n\t},\n});\nexport const OrderDeepPrice = new MoveStruct({\n\tname: `${$moduleName}::OrderDeepPrice`,\n\tfields: {\n\t\tasset_is_base: bcs.bool(),\n\t\tdeep_per_asset: bcs.u64(),\n\t},\n});\nexport interface AssetIsBaseArguments {\n\tself: TransactionArgument;\n}\nexport interface AssetIsBaseOptions {\n\tpackage?: string;\n\targuments: AssetIsBaseArguments | [self: TransactionArgument];\n}\nexport function assetIsBase(options: AssetIsBaseOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'deep_price',\n\t\t\tfunction: 'asset_is_base',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface DeepPerAssetArguments {\n\tself: TransactionArgument;\n}\nexport interface DeepPerAssetOptions {\n\tpackage?: string;\n\targuments: DeepPerAssetArguments | [self: TransactionArgument];\n}\nexport function deepPerAsset(options: DeepPerAssetOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'deep_price',\n\t\t\tfunction: 'deep_per_asset',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,iBAAiB,IAAI,KAAK;EAC1B,WAAW,IAAI,KAAK;EACpB;CACD,CAAC;AACF,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,iBAAiB,IAAI,KAAK;EAC1B,WAAW,IAAI,KAAK;EACpB,oBAAoB,IAAI,MAAM;EAC9B,gBAAgB,IAAI;EACpB,aAAa,IAAI;EACjB;CACD,CAAC;AACF,MAAa,YAAY,IAAI,WAAW;CACvC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,aAAa,IAAI,OAAO,MAAM;EAC9B,iBAAiB,IAAI,KAAK;EAC1B,cAAc,IAAI,OAAO,MAAM;EAC/B,kBAAkB,IAAI,KAAK;EAC3B;CACD,CAAC;AACF,MAAa,iBAAiB,IAAI,WAAW;CAC5C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,eAAe,IAAI,MAAM;EACzB,gBAAgB,IAAI,KAAK;EACzB;CACD,CAAC"}