{"version":3,"file":"committee.mjs","names":["vec_map.VecMap"],"sources":["../../../src/contracts/walrus/committee.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * This module defines the `Committee` struct which stores the current committee\n * with shard assignments. Additionally, it manages transitions / transfers of\n * shards between committees with the least amount of changes.\n */\n\nimport { MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as vec_map from './deps/sui/vec_map.js';\nconst $moduleName = '@local-pkg/walrus::committee';\nexport const Committee = new MoveTuple({\n\tname: `${$moduleName}::Committee`,\n\tfields: [vec_map.VecMap(bcs.Address, bcs.vector(bcs.u16()))],\n});\nexport interface ShardsArguments {\n\tcmt: TransactionArgument;\n\tnodeId: RawTransactionArgument<string>;\n}\nexport interface ShardsOptions {\n\tpackage?: string;\n\targuments: ShardsArguments | [cmt: TransactionArgument, nodeId: RawTransactionArgument<string>];\n}\n/** Get the shards assigned to the given `node_id`. */\nexport function shards(options: ShardsOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/walrus';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\tconst parameterNames = ['cmt', 'nodeId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'committee',\n\t\t\tfunction: 'shards',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SizeArguments {\n\tcmt: TransactionArgument;\n}\nexport interface SizeOptions {\n\tpackage?: string;\n\targuments: SizeArguments | [cmt: TransactionArgument];\n}\n/** Get the number of nodes in the committee. */\nexport function size(options: SizeOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/walrus';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['cmt'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'committee',\n\t\t\tfunction: 'size',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface InnerArguments {\n\tcmt: TransactionArgument;\n}\nexport interface InnerOptions {\n\tpackage?: string;\n\targuments: InnerArguments | [cmt: TransactionArgument];\n}\n/** Get the inner representation of the committee. */\nexport function inner(options: InnerOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/walrus';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['cmt'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'committee',\n\t\t\tfunction: 'inner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface ToInnerArguments {\n\tcmt: TransactionArgument;\n}\nexport interface ToInnerOptions {\n\tpackage?: string;\n\targuments: ToInnerArguments | [cmt: TransactionArgument];\n}\n/** Copy the inner representation of the committee. */\nexport function toInner(options: ToInnerOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/walrus';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['cmt'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'committee',\n\t\t\tfunction: 'to_inner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,cAAc;AACpB,MAAa,YAAY,IAAI,UAAU;CACtC,MAAM,GAAG,YAAY;CACrB,QAAQ,CAACA,OAAe,IAAI,SAAS,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC;CAC5D,CAAC"}