{"version":3,"file":"protocol_fees.mjs","names":["table.Table","vec_map.VecMap"],"sources":["../../../src/contracts/deepbook_margin/protocol_fees.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 table from './deps/sui/table.js';\nimport * as vec_map from './deps/sui/vec_map.js';\nconst $moduleName = '@deepbook/margin::protocol_fees';\nexport const ProtocolFees = new MoveStruct({\n\tname: `${$moduleName}::ProtocolFees`,\n\tfields: {\n\t\treferrals: table.Table,\n\t\ttotal_shares: bcs.u64(),\n\t\tfees_per_share: bcs.u64(),\n\t\tmaintainer_fees: bcs.u64(),\n\t\tprotocol_fees: bcs.u64(),\n\t\textra_fields: vec_map.VecMap(bcs.string(), bcs.u64()),\n\t},\n});\nexport const ReferralTracker = new MoveStruct({\n\tname: `${$moduleName}::ReferralTracker`,\n\tfields: {\n\t\tcurrent_shares: bcs.u64(),\n\t\tlast_fees_per_share: bcs.u64(),\n\t\tunclaimed_fees: bcs.u64(),\n\t},\n});\nexport const SupplyReferral = new MoveStruct({\n\tname: `${$moduleName}::SupplyReferral`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\towner: bcs.Address,\n\t},\n});\nexport const ProtocolFeesIncreasedEvent = new MoveStruct({\n\tname: `${$moduleName}::ProtocolFeesIncreasedEvent`,\n\tfields: {\n\t\tmargin_pool_id: bcs.Address,\n\t\ttotal_shares: bcs.u64(),\n\t\treferral_fees: bcs.u64(),\n\t\tmaintainer_fees: bcs.u64(),\n\t\tprotocol_fees: bcs.u64(),\n\t},\n});\nexport const ReferralFeesClaimedEvent = new MoveStruct({\n\tname: `${$moduleName}::ReferralFeesClaimedEvent`,\n\tfields: {\n\t\treferral_id: bcs.Address,\n\t\towner: bcs.Address,\n\t\tfees: bcs.u64(),\n\t},\n});\nexport interface MaintainerFeesArguments {\n\tself: TransactionArgument;\n}\nexport interface MaintainerFeesOptions {\n\tpackage?: string;\n\targuments: MaintainerFeesArguments | [self: TransactionArgument];\n}\n/** Get the maintainer fees. */\nexport function maintainerFees(options: MaintainerFeesOptions) {\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: 'protocol_fees',\n\t\t\tfunction: 'maintainer_fees',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface ProtocolFeesArguments {\n\tself: TransactionArgument;\n}\nexport interface ProtocolFeesOptions {\n\tpackage?: string;\n\targuments: ProtocolFeesArguments | [self: TransactionArgument];\n}\n/** Get the protocol fees. */\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: 'protocol_fees',\n\t\t\tfunction: 'protocol_fees',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface ReferralTrackerArguments {\n\tself: TransactionArgument;\n\treferral: RawTransactionArgument<string>;\n}\nexport interface ReferralTrackerOptions {\n\tpackage?: string;\n\targuments:\n\t\t| ReferralTrackerArguments\n\t\t| [self: TransactionArgument, referral: RawTransactionArgument<string>];\n}\nexport function referralTracker(options: ReferralTrackerOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/margin';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'referral'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'protocol_fees',\n\t\t\tfunction: 'referral_tracker',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface TotalSharesArguments {\n\tself: TransactionArgument;\n}\nexport interface TotalSharesOptions {\n\tpackage?: string;\n\targuments: TotalSharesArguments | [self: TransactionArgument];\n}\nexport function totalShares(options: TotalSharesOptions) {\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: 'protocol_fees',\n\t\t\tfunction: 'total_shares',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface FeesPerShareArguments {\n\tself: TransactionArgument;\n}\nexport interface FeesPerShareOptions {\n\tpackage?: string;\n\targuments: FeesPerShareArguments | [self: TransactionArgument];\n}\nexport function feesPerShare(options: FeesPerShareOptions) {\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: 'protocol_fees',\n\t\t\tfunction: 'fees_per_share',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,WAAWA;EACX,cAAc,IAAI,KAAK;EACvB,gBAAgB,IAAI,KAAK;EACzB,iBAAiB,IAAI,KAAK;EAC1B,eAAe,IAAI,KAAK;EACxB,cAAcC,OAAe,IAAI,QAAQ,EAAE,IAAI,KAAK,CAAC;EACrD;CACD,CAAC;AACF,MAAa,kBAAkB,IAAI,WAAW;CAC7C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,gBAAgB,IAAI,KAAK;EACzB,qBAAqB,IAAI,KAAK;EAC9B,gBAAgB,IAAI,KAAK;EACzB;CACD,CAAC;AACF,MAAa,iBAAiB,IAAI,WAAW;CAC5C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,OAAO,IAAI;EACX;CACD,CAAC;AACF,MAAa,6BAA6B,IAAI,WAAW;CACxD,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,gBAAgB,IAAI;EACpB,cAAc,IAAI,KAAK;EACvB,eAAe,IAAI,KAAK;EACxB,iBAAiB,IAAI,KAAK;EAC1B,eAAe,IAAI,KAAK;EACxB;CACD,CAAC;AACF,MAAa,2BAA2B,IAAI,WAAW;CACtD,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,aAAa,IAAI;EACjB,OAAO,IAAI;EACX,MAAM,IAAI,KAAK;EACf;CACD,CAAC"}