{"version":3,"file":"staking_pool.mjs","names":["storage_node.StorageNodeInfo","pending_values.PendingValues","table.Table","balance.Balance","auth.Authorized","bag.Bag"],"sources":["../../../src/contracts/walrus/staking_pool.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/** Module: staking_pool */\n\nimport { MoveStruct, MoveEnum } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport * as storage_node from './storage_node.js';\nimport * as pending_values from './pending_values.js';\nimport * as table from './deps/sui/table.js';\nimport * as balance from './deps/sui/balance.js';\nimport * as auth from './auth.js';\nimport * as bag from './deps/sui/bag.js';\nconst $moduleName = '@local-pkg/walrus::staking_pool';\nexport const NewEpochCommissionBlockedForCollection = new MoveStruct({\n\tname: `${$moduleName}::NewEpochCommissionBlockedForCollection`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const VotingParams = new MoveStruct({\n\tname: `${$moduleName}::VotingParams`,\n\tfields: {\n\t\t/** Voting: storage price for the next epoch. */\n\t\tstorage_price: bcs.u64(),\n\t\t/** Voting: write price for the next epoch. */\n\t\twrite_price: bcs.u64(),\n\t\t/** Voting: node capacity for the next epoch. */\n\t\tnode_capacity: bcs.u64(),\n\t},\n});\n/** Represents the state of the staking pool. */\nexport const PoolState = new MoveEnum({\n\tname: `${$moduleName}::PoolState`,\n\tfields: {\n\t\tActive: null,\n\t\tWithdrawing: bcs.u32(),\n\t\tWithdrawn: null,\n\t},\n});\nexport const StakingPool = new MoveStruct({\n\tname: `${$moduleName}::StakingPool`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\t/** The current state of the pool. */\n\t\tstate: PoolState,\n\t\t/** Current epoch's pool parameters. */\n\t\tvoting_params: VotingParams,\n\t\t/** The storage node info for the pool. */\n\t\tnode_info: storage_node.StorageNodeInfo,\n\t\t/**\n\t\t * The epoch when the pool is / will be activated. Serves information purposes\n\t\t * only, the checks are performed in the `state` property.\n\t\t */\n\t\tactivation_epoch: bcs.u32(),\n\t\t/** Epoch when the pool was last updated. */\n\t\tlatest_epoch: bcs.u32(),\n\t\t/** Currently staked WAL in the pool + rewards pool. */\n\t\twal_balance: bcs.u64(),\n\t\t/** The total number of shares in the current epoch. */\n\t\tnum_shares: bcs.u64(),\n\t\t/**\n\t\t * The amount of the shares that will be withdrawn in E+1 or E+2. We use this\n\t\t * amount to calculate the WAL withdrawal in the `process_pending_stake`.\n\t\t */\n\t\tpending_shares_withdraw: pending_values.PendingValues,\n\t\t/**\n\t\t * The amount of the stake requested for withdrawal for a node that may part of the\n\t\t * next committee. Stores principals of not yet active stakes. In practice, those\n\t\t * tokens are staked for exactly one epoch.\n\t\t */\n\t\tpre_active_withdrawals: pending_values.PendingValues,\n\t\t/**\n\t\t * The pending commission rate for the pool. Commission rate is applied in E+2, so\n\t\t * we store the value for the matching epoch and apply it in the `advance_epoch`\n\t\t * function.\n\t\t */\n\t\tpending_commission_rate: pending_values.PendingValues,\n\t\t/** The commission rate for the pool, in basis points. */\n\t\tcommission_rate: bcs.u16(),\n\t\t/**\n\t\t * Historical exchange rates for the pool. The key is the epoch when the exchange\n\t\t * rate was set, and the value is the exchange rate (the ratio of the amount of WAL\n\t\t * tokens for the pool shares).\n\t\t */\n\t\texchange_rates: table.Table,\n\t\t/**\n\t\t * The amount of stake that will be added to the `wal_balance`. Can hold up to two\n\t\t * keys: E+1 and E+2, due to the differences in the activation epoch.\n\t\t *\n\t\t * ```\n\t\t * E+1 -> Balance\n\t\t * E+2 -> Balance\n\t\t * ```\n\t\t *\n\t\t * Single key is cleared in the `advance_epoch` function, leaving only the next\n\t\t * epoch's stake.\n\t\t */\n\t\tpending_stake: pending_values.PendingValues,\n\t\t/** The rewards that the pool has received from being in the committee. */\n\t\trewards_pool: balance.Balance,\n\t\t/** The commission that the pool has received from the rewards. */\n\t\tcommission: balance.Balance,\n\t\t/** An Object or an address which can claim the commission. */\n\t\tcommission_receiver: auth.Authorized,\n\t\t/** An Object or address that can authorize governance actions, such as upgrades. */\n\t\tgovernance_authorized: auth.Authorized,\n\t\t/** Reserved for future use and migrations. */\n\t\textra_fields: bag.Bag,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,cAAc;AACpB,MAAa,yCAAyC,IAAI,WAAW;CACpE,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ;EAEP,eAAe,IAAI,KAAK;EAExB,aAAa,IAAI,KAAK;EAEtB,eAAe,IAAI,KAAK;EACxB;CACD,CAAC;;AAEF,MAAa,YAAY,IAAI,SAAS;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,QAAQ;EACR,aAAa,IAAI,KAAK;EACtB,WAAW;EACX;CACD,CAAC;AACF,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EAER,OAAO;EAEP,eAAe;EAEf,WAAWA;EAKX,kBAAkB,IAAI,KAAK;EAE3B,cAAc,IAAI,KAAK;EAEvB,aAAa,IAAI,KAAK;EAEtB,YAAY,IAAI,KAAK;EAKrB,yBAAyBC;EAMzB,wBAAwBA;EAMxB,yBAAyBA;EAEzB,iBAAiB,IAAI,KAAK;EAM1B,gBAAgBC;EAahB,eAAeD;EAEf,cAAcE;EAEd,YAAYA;EAEZ,qBAAqBC;EAErB,uBAAuBA;EAEvB,cAAcC;EACd;CACD,CAAC"}