{"version":3,"file":"margin_pool.mjs","names":["balance.Balance","margin_state.State","protocol_config.ProtocolConfig","protocol_fees.ProtocolFees","position_manager.PositionManager","vec_set.VecSet","rate_limiter.RateLimiter","vec_map.VecMap","type_name.TypeName","protocol_config.InterestConfig","protocol_config.MarginPoolConfig"],"sources":["../../../src/contracts/deepbook_margin/margin_pool.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as balance from './deps/sui/balance.js';\nimport * as margin_state from './margin_state.js';\nimport * as protocol_config from './protocol_config.js';\nimport * as protocol_fees from './protocol_fees.js';\nimport * as position_manager from './position_manager.js';\nimport * as vec_set from './deps/sui/vec_set.js';\nimport * as rate_limiter from './rate_limiter.js';\nimport * as vec_map from './deps/sui/vec_map.js';\nimport * as type_name from './deps/std/type_name.js';\nconst $moduleName = '@deepbook/margin::margin_pool';\nexport const MarginPool = new MoveStruct({\n\tname: `${$moduleName}::MarginPool<phantom Asset>`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tvault: balance.Balance,\n\t\tstate: margin_state.State,\n\t\tconfig: protocol_config.ProtocolConfig,\n\t\tprotocol_fees: protocol_fees.ProtocolFees,\n\t\tpositions: position_manager.PositionManager,\n\t\tallowed_deepbook_pools: vec_set.VecSet(bcs.Address),\n\t\trate_limiter: rate_limiter.RateLimiter,\n\t\textra_fields: vec_map.VecMap(bcs.string(), bcs.u64()),\n\t},\n});\nexport const SupplierCap = new MoveStruct({\n\tname: `${$moduleName}::SupplierCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const MarginPoolCreated = new MoveStruct({\n\tname: `${$moduleName}::MarginPoolCreated`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tmaintainer_cap_id: bcs.Address,\n\t\tasset_type: type_name.TypeName,\n\t\tconfig: protocol_config.ProtocolConfig,\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const MaintainerFeesWithdrawn = new MoveStruct({\n\tname: `${$moduleName}::MaintainerFeesWithdrawn`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tmargin_pool_cap_id: bcs.Address,\n\t\tmaintainer_fees: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const ProtocolFeesWithdrawn = new MoveStruct({\n\tname: `${$moduleName}::ProtocolFeesWithdrawn`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tprotocol_fees: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const DeepbookPoolUpdated = new MoveStruct({\n\tname: `${$moduleName}::DeepbookPoolUpdated`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tdeepbook_pool_id: bcs.Address,\n\t\tpool_cap_id: bcs.Address,\n\t\tenabled: bcs.bool(),\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const InterestParamsUpdated = new MoveStruct({\n\tname: `${$moduleName}::InterestParamsUpdated`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tpool_cap_id: bcs.Address,\n\t\tinterest_config: protocol_config.InterestConfig,\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const MarginPoolConfigUpdated = new MoveStruct({\n\tname: `${$moduleName}::MarginPoolConfigUpdated`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tpool_cap_id: bcs.Address,\n\t\tmargin_pool_config: protocol_config.MarginPoolConfig,\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const AssetSupplied = new MoveStruct({\n\tname: `${$moduleName}::AssetSupplied`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tasset_type: type_name.TypeName,\n\t\tsupplier_cap_id: bcs.Address,\n\t\tsupply_amount: bcs.u64(),\n\t\tsupply_shares: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const AssetWithdrawn = new MoveStruct({\n\tname: `${$moduleName}::AssetWithdrawn`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tasset_type: type_name.TypeName,\n\t\tsupplier_cap_id: bcs.Address,\n\t\twithdraw_amount: bcs.u64(),\n\t\twithdraw_shares: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const SupplierCapMinted = new MoveStruct({\n\tname: `${$moduleName}::SupplierCapMinted`,\n\tfields: {\n\t\tsupplier_cap_id: bcs.Address,\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const SupplyReferralMinted = new MoveStruct({\n\tname: `${$moduleName}::SupplyReferralMinted`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\tsupply_referral_id: bcs.Address,\n\t\towner: bcs.Address,\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport interface CreateMarginPoolArguments {\n\tregistry: RawTransactionArgument<string>;\n\tconfig: TransactionArgument;\n\tmaintainerCap: RawTransactionArgument<string>;\n}\nexport interface CreateMarginPoolOptions {\n\tpackage?: string;\n\targuments:\n\t\t| CreateMarginPoolArguments\n\t\t| [\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tconfig: TransactionArgument,\n\t\t\t\tmaintainerCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/**\n * Creates and registers a new margin pool. If a same asset pool already exists,\n * abort. Sends a `MarginPoolCap` to the pool creator. Returns the created margin\n * pool id.\n */\nexport function createMarginPool(options: CreateMarginPoolOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['registry', 'config', 'maintainerCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'create_margin_pool',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface EnableDeepbookPoolForLoanArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tdeepbookPoolId: RawTransactionArgument<string>;\n\tmarginPoolCap: RawTransactionArgument<string>;\n}\nexport interface EnableDeepbookPoolForLoanOptions {\n\tpackage?: string;\n\targuments:\n\t\t| EnableDeepbookPoolForLoanArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tdeepbookPoolId: RawTransactionArgument<string>,\n\t\t\t\tmarginPoolCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/** Allow a margin manager tied to a deepbook pool to borrow from the margin pool. */\nexport function enableDeepbookPoolForLoan(options: EnableDeepbookPoolForLoanOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, '0x2::object::ID', null, '0x2::clock::Clock'] satisfies (\n\t\tstring | null\n\t)[];\n\tconst parameterNames = ['self', 'registry', 'deepbookPoolId', 'marginPoolCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'enable_deepbook_pool_for_loan',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DisableDeepbookPoolForLoanArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tdeepbookPoolId: RawTransactionArgument<string>;\n\tmarginPoolCap: RawTransactionArgument<string>;\n}\nexport interface DisableDeepbookPoolForLoanOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DisableDeepbookPoolForLoanArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tdeepbookPoolId: RawTransactionArgument<string>,\n\t\t\t\tmarginPoolCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/**\n * Disable a margin manager tied to a deepbook pool from borrowing from the margin\n * pool.\n */\nexport function disableDeepbookPoolForLoan(options: DisableDeepbookPoolForLoanOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, '0x2::object::ID', null, '0x2::clock::Clock'] satisfies (\n\t\tstring | null\n\t)[];\n\tconst parameterNames = ['self', 'registry', 'deepbookPoolId', 'marginPoolCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'disable_deepbook_pool_for_loan',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface UpdateInterestParamsArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tinterestConfig: TransactionArgument;\n\tmarginPoolCap: RawTransactionArgument<string>;\n}\nexport interface UpdateInterestParamsOptions {\n\tpackage?: string;\n\targuments:\n\t\t| UpdateInterestParamsArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tinterestConfig: TransactionArgument,\n\t\t\t\tmarginPoolCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/** Updates interest params for the margin pool */\nexport function updateInterestParams(options: UpdateInterestParamsOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'interestConfig', 'marginPoolCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'update_interest_params',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface UpdateMarginPoolConfigArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tmarginPoolConfig: TransactionArgument;\n\tmarginPoolCap: RawTransactionArgument<string>;\n}\nexport interface UpdateMarginPoolConfigOptions {\n\tpackage?: string;\n\targuments:\n\t\t| UpdateMarginPoolConfigArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tmarginPoolConfig: TransactionArgument,\n\t\t\t\tmarginPoolCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/** Updates margin pool config */\nexport function updateMarginPoolConfig(options: UpdateMarginPoolConfigOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'marginPoolConfig', 'marginPoolCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'update_margin_pool_config',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface AdminInjectCapitalArguments {\n\tself: RawTransactionArgument<string>;\n\tAdminCap: RawTransactionArgument<string>;\n\tcoin: RawTransactionArgument<string>;\n}\nexport interface AdminInjectCapitalOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AdminInjectCapitalArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tAdminCap: RawTransactionArgument<string>,\n\t\t\t\tcoin: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/** Inject capital into the margin pool without minting supplier shares. */\nexport function adminInjectCapital(options: AdminInjectCapitalOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'AdminCap', 'coin'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'admin_inject_capital',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface MintSupplierCapArguments {\n\tregistry: RawTransactionArgument<string>;\n}\nexport interface MintSupplierCapOptions {\n\tpackage?: string;\n\targuments: MintSupplierCapArguments | [registry: RawTransactionArgument<string>];\n}\n/**\n * Mint a new SupplierCap, which is used to supply and withdraw from margin pools.\n * One SupplierCap can be used to supply and withdraw from multiple margin pools.\n */\nexport function mintSupplierCap(options: MintSupplierCapOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['registry'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'mint_supplier_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SupplyArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tsupplierCap: RawTransactionArgument<string>;\n\tcoin: RawTransactionArgument<string>;\n\treferral: RawTransactionArgument<string | null>;\n}\nexport interface SupplyOptions {\n\tpackage?: string;\n\targuments:\n\t\t| SupplyArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tsupplierCap: RawTransactionArgument<string>,\n\t\t\t\tcoin: RawTransactionArgument<string>,\n\t\t\t\treferral: RawTransactionArgument<string | null>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/**\n * Supply to the margin pool using a SupplierCap. Returns the new supply shares.\n * The `referral` parameter should be the ID of a SupplyReferral object if referral\n * tracking is desired.\n */\nexport function supply(options: SupplyOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'0x1::option::Option<0x2::object::ID>',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'supplierCap', 'coin', 'referral'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'supply',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface WithdrawArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tsupplierCap: RawTransactionArgument<string>;\n\tamount: RawTransactionArgument<number | bigint | null>;\n}\nexport interface WithdrawOptions {\n\tpackage?: string;\n\targuments:\n\t\t| WithdrawArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tsupplierCap: RawTransactionArgument<string>,\n\t\t\t\tamount: RawTransactionArgument<number | bigint | null>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/** Withdraw from the margin pool using a SupplierCap. Returns the withdrawn coin. */\nexport function withdraw(options: WithdrawOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'0x1::option::Option<u64>',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'supplierCap', 'amount'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'withdraw',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface MintSupplyReferralArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n}\nexport interface MintSupplyReferralOptions {\n\tpackage?: string;\n\targuments:\n\t\t| MintSupplyReferralArguments\n\t\t| [self: RawTransactionArgument<string>, registry: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Mint a supply referral. */\nexport function mintSupplyReferral(options: MintSupplyReferralOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'mint_supply_referral',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface WithdrawReferralFeesArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\treferral: RawTransactionArgument<string>;\n}\nexport interface WithdrawReferralFeesOptions {\n\tpackage?: string;\n\targuments:\n\t\t| WithdrawReferralFeesArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\treferral: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/** Withdraw the referral fees. */\nexport function withdrawReferralFees(options: WithdrawReferralFeesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'referral'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'withdraw_referral_fees',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface AdminWithdrawDefaultReferralFeesArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tAdminCap: RawTransactionArgument<string>;\n}\nexport interface AdminWithdrawDefaultReferralFeesOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AdminWithdrawDefaultReferralFeesArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tAdminCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/**\n * Withdraw the default referral fees (admin only). The default referral at 0x0\n * doesn't have a SupplyReferral object,\n */\nexport function adminWithdrawDefaultReferralFees(options: AdminWithdrawDefaultReferralFeesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'AdminCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'admin_withdraw_default_referral_fees',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface WithdrawMaintainerFeesArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tmarginPoolCap: RawTransactionArgument<string>;\n}\nexport interface WithdrawMaintainerFeesOptions {\n\tpackage?: string;\n\targuments:\n\t\t| WithdrawMaintainerFeesArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tmarginPoolCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/**\n * Withdraw the maintainer fees. The `margin_pool_cap` parameter is used to ensure\n * the correct margin pool is being withdrawn from.\n */\nexport function withdrawMaintainerFees(options: WithdrawMaintainerFeesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'marginPoolCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'withdraw_maintainer_fees',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface WithdrawProtocolFeesArguments {\n\tself: RawTransactionArgument<string>;\n\tregistry: RawTransactionArgument<string>;\n\tAdminCap: RawTransactionArgument<string>;\n}\nexport interface WithdrawProtocolFeesOptions {\n\tpackage?: string;\n\targuments:\n\t\t| WithdrawProtocolFeesArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tregistry: RawTransactionArgument<string>,\n\t\t\t\tAdminCap: RawTransactionArgument<string>,\n\t\t  ];\n\ttypeArguments: [string];\n}\n/** Withdraw the protocol fees. */\nexport function withdrawProtocolFees(options: WithdrawProtocolFeesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'registry', 'AdminCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'withdraw_protocol_fees',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface IdArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface IdOptions {\n\tpackage?: string;\n\targuments: IdArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the ID of the margin pool. */\nexport function id(options: IdOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'id',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DeepbookPoolAllowedArguments {\n\tself: RawTransactionArgument<string>;\n\tdeepbookPoolId: RawTransactionArgument<string>;\n}\nexport interface DeepbookPoolAllowedOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DeepbookPoolAllowedArguments\n\t\t| [self: RawTransactionArgument<string>, deepbookPoolId: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/**\n * Return whether a margin manager for a given deepbook pool is allowed to borrow\n * from the margin pool.\n */\nexport function deepbookPoolAllowed(options: DeepbookPoolAllowedOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'deepbookPoolId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'deepbook_pool_allowed',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface TotalSupplyArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TotalSupplyOptions {\n\tpackage?: string;\n\targuments: TotalSupplyArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current total supply of the margin pool. */\nexport function totalSupply(options: TotalSupplyOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'total_supply',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface TotalSupplyWithInterestArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TotalSupplyWithInterestOptions {\n\tpackage?: string;\n\targuments: TotalSupplyWithInterestArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current total supply of the margin pool including accrued interest. */\nexport function totalSupplyWithInterest(options: TotalSupplyWithInterestOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'total_supply_with_interest',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface SupplySharesArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface SupplySharesOptions {\n\tpackage?: string;\n\targuments: SupplySharesArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current total supply shares of the margin pool. */\nexport function supplyShares(options: SupplySharesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'supply_shares',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface SupplyRatioArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface SupplyRatioOptions {\n\tpackage?: string;\n\targuments: SupplyRatioArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current supply ratio of the margin pool. */\nexport function supplyRatio(options: SupplyRatioOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'supply_ratio',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface TotalBorrowArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TotalBorrowOptions {\n\tpackage?: string;\n\targuments: TotalBorrowArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current total borrow of the margin pool. */\nexport function totalBorrow(options: TotalBorrowOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'total_borrow',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface BorrowSharesArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowSharesOptions {\n\tpackage?: string;\n\targuments: BorrowSharesArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current total borrow shares of the margin pool. */\nexport function borrowShares(options: BorrowSharesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'borrow_shares',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface BorrowRatioArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowRatioOptions {\n\tpackage?: string;\n\targuments: BorrowRatioArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current borrow ratio of the margin pool. */\nexport function borrowRatio(options: BorrowRatioOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'borrow_ratio',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface LastUpdateTimestampArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface LastUpdateTimestampOptions {\n\tpackage?: string;\n\targuments: LastUpdateTimestampArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the last update timestamp of the margin pool. */\nexport function lastUpdateTimestamp(options: LastUpdateTimestampOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'last_update_timestamp',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface SupplyCapArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface SupplyCapOptions {\n\tpackage?: string;\n\targuments: SupplyCapArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the supply cap of the margin pool. */\nexport function supplyCap(options: SupplyCapOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'supply_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProtocolFeesArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface ProtocolFeesOptions {\n\tpackage?: string;\n\targuments: ProtocolFeesArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current protocol fees of the margin pool. */\nexport function protocolFees(options: ProtocolFeesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'protocol_fees',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface MaxUtilizationRateArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface MaxUtilizationRateOptions {\n\tpackage?: string;\n\targuments: MaxUtilizationRateArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current max utilization rate of the margin pool. */\nexport function maxUtilizationRate(options: MaxUtilizationRateOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'max_utilization_rate',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProtocolSpreadArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface ProtocolSpreadOptions {\n\tpackage?: string;\n\targuments: ProtocolSpreadArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current protocol spread of the margin pool. */\nexport function protocolSpread(options: ProtocolSpreadOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'protocol_spread',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface MinBorrowArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface MinBorrowOptions {\n\tpackage?: string;\n\targuments: MinBorrowArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current min borrow of the margin pool. */\nexport function minBorrow(options: MinBorrowOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'min_borrow',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface InterestRateArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface InterestRateOptions {\n\tpackage?: string;\n\targuments: InterestRateArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/**\n * Return the current interest rate of the margin pool. Represented in 9 decimal\n * places.\n */\nexport function interestRate(options: InterestRateOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'interest_rate',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface TrueInterestRateArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TrueInterestRateOptions {\n\tpackage?: string;\n\targuments: TrueInterestRateArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function trueInterestRate(options: TrueInterestRateOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'true_interest_rate',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface UserSupplySharesArguments {\n\tself: RawTransactionArgument<string>;\n\tsupplierCapId: RawTransactionArgument<string>;\n}\nexport interface UserSupplySharesOptions {\n\tpackage?: string;\n\targuments:\n\t\t| UserSupplySharesArguments\n\t\t| [self: RawTransactionArgument<string>, supplierCapId: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current user supply shares of the margin pool. */\nexport function userSupplyShares(options: UserSupplySharesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'supplierCapId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'user_supply_shares',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface VaultBalanceArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface VaultBalanceOptions {\n\tpackage?: string;\n\targuments: VaultBalanceArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current vault balance of the margin pool. */\nexport function vaultBalance(options: VaultBalanceOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'vault_balance',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface UserSupplyAmountArguments {\n\tself: RawTransactionArgument<string>;\n\tsupplierCapId: RawTransactionArgument<string>;\n}\nexport interface UserSupplyAmountOptions {\n\tpackage?: string;\n\targuments:\n\t\t| UserSupplyAmountArguments\n\t\t| [self: RawTransactionArgument<string>, supplierCapId: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Return the current user supply amount of the margin pool. */\nexport function userSupplyAmount(options: UserSupplyAmountOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, '0x2::object::ID', '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'supplierCapId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'user_supply_amount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface GetAvailableWithdrawalArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface GetAvailableWithdrawalOptions {\n\tpackage?: string;\n\targuments: GetAvailableWithdrawalArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Returns the maximum amount that can be withdrawn without hitting rate limits */\nexport function getAvailableWithdrawal(options: GetAvailableWithdrawalOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'margin_pool',\n\t\t\tfunction: 'get_available_withdrawal',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface IsRateLimitEnabledArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface IsRateLimitEnabledOptions {\n\tpackage?: string;\n\targuments: IsRateLimitEnabledArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Returns whether rate limiting is enabled */\nexport function isRateLimitEnabled(options: IsRateLimitEnabledOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'is_rate_limit_enabled',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface RateLimitCapacityArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface RateLimitCapacityOptions {\n\tpackage?: string;\n\targuments: RateLimitCapacityArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Returns the rate limit capacity (max bucket size) */\nexport function rateLimitCapacity(options: RateLimitCapacityOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'rate_limit_capacity',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface RateLimitRefillRatePerMsArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface RateLimitRefillRatePerMsOptions {\n\tpackage?: string;\n\targuments: RateLimitRefillRatePerMsArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Returns the rate limit refill rate per millisecond */\nexport function rateLimitRefillRatePerMs(options: RateLimitRefillRatePerMsOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\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: 'margin_pool',\n\t\t\tfunction: 'rate_limit_refill_rate_per_ms',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"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