/** * Validator lifecycle: * 1. Prepare a validator node set up and call stake::initialize_validator * 2. Once ready to deposit stake (or have funds assigned by a staking service in exchange for ownership capability), * call stake::add_stake (or *_with_cap versions if called from the staking service) * 3. Call stake::join_validator_set (or _with_cap version) to join the active validator set. Changes are effective in * the next epoch. * 4. Validate and gain rewards. The stake will automatically be locked up for a fixed duration (set by governance) and * automatically renewed at expiration. * 5. At any point, if the validator operator wants to update the consensus key or network/fullnode addresses, they can * call stake::rotate_consensus_key and stake::update_network_and_fullnode_addresses. Similar to changes to stake, the * changes to consensus key/network/fullnode addresses are only effective in the next epoch. * 6. Validator can request to unlock their stake at any time. However, their stake will only become withdrawable when * their current lockup expires. This can be at most as long as the fixed lockup duration. * 7. After exiting, the validator can either explicitly leave the validator set by calling stake::leave_validator_set * or if their stake drops below the min required, they would get removed at the end of the epoch. * 8. Validator can always rejoin the validator set by going through steps 2-3 again. * 9. An owner can always switch operators by calling stake::set_operator. * 10. An owner can always switch designated voter by calling stake::set_designated_voter. * * **Module ID:** `0x1::stake` * * @module */ import type * as p from "@movingco/prelude"; /** * AptosCoin capabilities, set during genesis and stored in @CoreResource account. * This allows the Stake module to mint rewards to stakers. * * Type name: `0x1::stake::AptosCoinCapabilities` */ export interface IAptosCoinCapabilities { mint_cap: { dummy_field: boolean; }; } /** Type name: `0x1::stake::AddStakeEvent` */ export interface IAddStakeEvent { pool_address: p.RawAddress; amount_added: p.U64; } /** Type name: `0x1::stake::DistributeRewardsEvent` */ export interface IDistributeRewardsEvent { pool_address: p.RawAddress; rewards_amount: p.U64; } /** Type name: `0x1::stake::IncreaseLockupEvent` */ export interface IIncreaseLockupEvent { pool_address: p.RawAddress; old_locked_until_secs: p.U64; new_locked_until_secs: p.U64; } /** Type name: `0x1::stake::IndividualValidatorPerformance` */ export interface IIndividualValidatorPerformance { successful_proposals: p.U64; failed_proposals: p.U64; } /** Type name: `0x1::stake::JoinValidatorSetEvent` */ export interface IJoinValidatorSetEvent { pool_address: p.RawAddress; } /** Type name: `0x1::stake::LeaveValidatorSetEvent` */ export interface ILeaveValidatorSetEvent { pool_address: p.RawAddress; } /** * Capability that represents ownership and can be used to control the validator and the associated stake pool. * Having this be separate from the signer for the account that the validator resources are hosted at allows * modules to have control over a validator. * * Type name: `0x1::stake::OwnerCapability` */ export interface IOwnerCapability { pool_address: p.RawAddress; } /** Type name: `0x1::stake::ReactivateStakeEvent` */ export interface IReactivateStakeEvent { pool_address: p.RawAddress; amount: p.U64; } /** Type name: `0x1::stake::RegisterValidatorCandidateEvent` */ export interface IRegisterValidatorCandidateEvent { pool_address: p.RawAddress; } /** Type name: `0x1::stake::RotateConsensusKeyEvent` */ export interface IRotateConsensusKeyEvent { pool_address: p.RawAddress; old_consensus_pubkey: p.ByteString; new_consensus_pubkey: p.ByteString; } /** Type name: `0x1::stake::SetOperatorEvent` */ export interface ISetOperatorEvent { pool_address: p.RawAddress; old_operator: p.RawAddress; new_operator: p.RawAddress; } /** * Each validator has a separate StakePool resource and can provide a stake. * Changes in stake for an active validator: * 1. If a validator calls add_stake, the newly added stake is moved to pending_active. * 2. If validator calls unlock, their stake is moved to pending_inactive. * 2. When the next epoch starts, any pending_inactive stake is moved to inactive and can be withdrawn. * Any pending_active stake is moved to active and adds to the validator's voting power. * * Changes in stake for an inactive validator: * 1. If a validator calls add_stake, the newly added stake is moved directly to active. * 2. If validator calls unlock, their stake is moved directly to inactive. * 3. When the next epoch starts, the validator can be activated if their active stake is more than the minimum. * * Type name: `0x1::stake::StakePool` */ export interface IStakePool { active: { /** Amount of coin this address has. */ value: p.U64; }; inactive: { /** Amount of coin this address has. */ value: p.U64; }; pending_active: { /** Amount of coin this address has. */ value: p.U64; }; pending_inactive: { /** Amount of coin this address has. */ value: p.U64; }; locked_until_secs: p.U64; operator_address: p.RawAddress; delegated_voter: p.RawAddress; initialize_validator_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; set_operator_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; add_stake_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; reactivate_stake_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; rotate_consensus_key_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; update_network_and_fullnode_addresses_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; increase_lockup_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; join_validator_set_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; distribute_rewards_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; unlock_stake_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; withdraw_stake_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; leave_validator_set_events: { /** Total number of events emitted to this event stream. */ counter: p.U64; /** A globally unique ID for this event stream. */ guid: { id: { /** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */ creation_num: p.U64; /** Address that created the GUID */ addr: p.RawAddress; }; }; }; } /** Type name: `0x1::stake::UnlockStakeEvent` */ export interface IUnlockStakeEvent { pool_address: p.RawAddress; amount_unlocked: p.U64; } /** Type name: `0x1::stake::UpdateNetworkAndFullnodeAddressesEvent` */ export interface IUpdateNetworkAndFullnodeAddressesEvent { pool_address: p.RawAddress; old_network_addresses: p.ByteString; new_network_addresses: p.ByteString; old_fullnode_addresses: p.ByteString; new_fullnode_addresses: p.ByteString; } /** * Validator info stored in validator address. * * Type name: `0x1::stake::ValidatorConfig` */ export interface IValidatorConfig { consensus_pubkey: p.ByteString; network_addresses: p.ByteString; fullnode_addresses: p.ByteString; validator_index: p.U64; } /** * Consensus information per validator, stored in ValidatorSet. * * Type name: `0x1::stake::ValidatorInfo` */ export interface IValidatorInfo { addr: p.RawAddress; voting_power: p.U64; config: { consensus_pubkey: p.ByteString; network_addresses: p.ByteString; fullnode_addresses: p.ByteString; validator_index: p.U64; }; } /** Type name: `0x1::stake::ValidatorPerformance` */ export interface IValidatorPerformance { validators: ReadonlyArray<{ successful_proposals: p.U64; failed_proposals: p.U64; }>; } /** * Full ValidatorSet, stored in @aptos_framework. * 1. join_validator_set adds to pending_active queue. * 2. leave_valdiator_set moves from active to pending_inactive queue. * 3. on_new_epoch processes two pending queues and refresh ValidatorInfo from the owner's address. * * Type name: `0x1::stake::ValidatorSet` */ export interface IValidatorSet { consensus_scheme: number; active_validators: ReadonlyArray<{ addr: p.RawAddress; voting_power: p.U64; config: { consensus_pubkey: p.ByteString; network_addresses: p.ByteString; fullnode_addresses: p.ByteString; validator_index: p.U64; }; }>; pending_inactive: ReadonlyArray<{ addr: p.RawAddress; voting_power: p.U64; config: { consensus_pubkey: p.ByteString; network_addresses: p.ByteString; fullnode_addresses: p.ByteString; validator_index: p.U64; }; }>; pending_active: ReadonlyArray<{ addr: p.RawAddress; voting_power: p.U64; config: { consensus_pubkey: p.ByteString; network_addresses: p.ByteString; fullnode_addresses: p.ByteString; validator_index: p.U64; }; }>; total_voting_power: p.U128; total_joining_power: p.U128; } /** Type name: `0x1::stake::WithdrawStakeEvent` */ export interface IWithdrawStakeEvent { pool_address: p.RawAddress; amount_withdrawn: p.U64; } /** Payload arguments for {@link entry.withdraw}. */ export declare type WithdrawArgs = { args: { /** IDL type: `U64` */ withdraw_amount: p.U64; }; }; /** Payload arguments for {@link entry.add_stake}. */ export declare type AddStakeArgs = { args: { /** IDL type: `U64` */ amount: p.U64; }; }; /** Payload arguments for {@link entry.initialize_stake_owner}. */ export declare type InitializeStakeOwnerArgs = { args: { /** IDL type: `U64` */ initial_stake_amount: p.U64; /** IDL type: `Address` */ operator: p.RawAddress; /** IDL type: `Address` */ voter: p.RawAddress; }; }; /** Payload arguments for {@link entry.initialize_validator}. */ export declare type InitializeValidatorArgs = { args: { /** IDL type: `Vector(U8)` */ consensus_pubkey: p.ByteString; /** IDL type: `Vector(U8)` */ proof_of_possession: p.ByteString; /** IDL type: `Vector(U8)` */ network_addresses: p.ByteString; /** IDL type: `Vector(U8)` */ fullnode_addresses: p.ByteString; }; }; /** Payload arguments for {@link entry.join_validator_set}. */ export declare type JoinValidatorSetArgs = { args: { /** IDL type: `Address` */ pool_address: p.RawAddress; }; }; /** Payload arguments for {@link entry.leave_validator_set}. */ export declare type LeaveValidatorSetArgs = { args: { /** IDL type: `Address` */ pool_address: p.RawAddress; }; }; /** Payload arguments for {@link entry.reactivate_stake}. */ export declare type ReactivateStakeArgs = { args: { /** IDL type: `U64` */ amount: p.U64; }; }; /** Payload arguments for {@link entry.rotate_consensus_key}. */ export declare type RotateConsensusKeyArgs = { args: { /** IDL type: `Address` */ pool_address: p.RawAddress; /** IDL type: `Vector(U8)` */ new_consensus_pubkey: p.ByteString; /** IDL type: `Vector(U8)` */ proof_of_possession: p.ByteString; }; }; /** Payload arguments for {@link entry.set_delegated_voter}. */ export declare type SetDelegatedVoterArgs = { args: { /** IDL type: `Address` */ new_delegated_voter: p.RawAddress; }; }; /** Payload arguments for {@link entry.set_operator}. */ export declare type SetOperatorArgs = { args: { /** IDL type: `Address` */ new_operator: p.RawAddress; }; }; /** Payload arguments for {@link entry.unlock}. */ export declare type UnlockArgs = { args: { /** IDL type: `U64` */ amount: p.U64; }; }; /** Payload arguments for {@link entry.update_network_and_fullnode_addresses}. */ export declare type UpdateNetworkAndFullnodeAddressesArgs = { args: { /** IDL type: `Address` */ pool_address: p.RawAddress; /** IDL type: `Vector(U8)` */ new_network_addresses: p.ByteString; /** IDL type: `Vector(U8)` */ new_fullnode_addresses: p.ByteString; }; }; export * as entry from "./entry.js"; export * as entryNames from "./entryNames.js"; export { idl } from "./idl.js"; export * as payloads from "./payloads.js"; /** The address of the module. */ export declare const ADDRESS: "0x1"; /** The full module name. */ export declare const FULL_NAME: "0x1::stake"; /** The name of the module. */ export declare const NAME: "stake"; /** Module ID information. */ export declare const id: { readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::stake"; readonly NAME: "stake"; }; export * as errors from "./errors.js"; /** Module error codes. */ export declare const errorCodes: { readonly "1": { readonly name: "ELOCK_TIME_TOO_SHORT"; readonly doc: "Lockup period is shorter than required."; }; readonly "2": { readonly name: "EWITHDRAW_NOT_ALLOWED"; readonly doc: "Withdraw not allowed, the stake is still locked."; }; readonly "3": { readonly name: "EVALIDATOR_CONFIG"; readonly doc: "Validator Config not published."; }; readonly "4": { readonly name: "ESTAKE_TOO_LOW"; readonly doc: "Not enough stake to join validator set."; }; readonly "5": { readonly name: "ESTAKE_TOO_HIGH"; readonly doc: "Too much stake to join validator set."; }; readonly "6": { readonly name: "EALREADY_ACTIVE_VALIDATOR"; readonly doc: "Account is already a validator or pending validator."; }; readonly "7": { readonly name: "ENOT_VALIDATOR"; readonly doc: "Account is not a validator."; }; readonly "8": { readonly name: "ELAST_VALIDATOR"; readonly doc: "Can't remove last validator."; }; readonly "9": { readonly name: "ESTAKE_EXCEEDS_MAX"; readonly doc: "Total stake exceeds maximum allowed."; }; readonly "10": { readonly name: "EALREADY_REGISTERED"; readonly doc: "Account is already registered as a validator candidate."; }; readonly "11": { readonly name: "ENO_COINS_TO_WITHDRAW"; readonly doc: "No coins in inactive state to withdraw from specified pool."; }; readonly "12": { readonly name: "ENOT_OPERATOR"; readonly doc: "Account does not have the right operator capability."; }; readonly "13": { readonly name: "ELOCK_TIME_TOO_LONG"; readonly doc: "Lockup period is longer than allowed."; }; readonly "14": { readonly name: "ENO_POST_GENESIS_VALIDATOR_SET_CHANGE_ALLOWED"; }; readonly "15": { readonly name: "EINVALID_PUBLIC_KEY"; readonly doc: "Invalid consensus public key"; }; readonly "16": { readonly name: "EINVALID_STAKE_AMOUNT"; readonly doc: "Invalid stake amount (usuaully 0)."; }; readonly "18": { readonly name: "EVALIDATOR_SET_TOO_LARGE"; readonly doc: "Validator set exceeds the limit"; }; readonly "19": { readonly name: "EVOTING_POWER_INCREASE_EXCEEDS_LIMIT"; readonly doc: "Voting power increase has exceeded the limit for this current epoch."; }; }; /** All module function IDLs. */ export declare const functions: { readonly add_stake: { readonly name: "add_stake"; readonly doc: "Add `amount` of coins from the `account` owning the StakePool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "amount"; readonly ty: "u64"; }]; }; readonly increase_lockup: { readonly name: "increase_lockup"; readonly doc: "Similar to increase_lockup_with_cap but will use ownership capability from the signing account."; readonly ty_args: readonly []; readonly args: readonly []; }; readonly initialize_stake_owner: { readonly name: "initialize_stake_owner"; readonly doc: "Initialize the validator account and give ownership to the signing account\nexcept it leaves the ValidatorConfig to be set by another entity.\nNote: this triggers setting the operator and owner, set it to the account's address\nto set later."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "initial_stake_amount"; readonly ty: "u64"; }, { readonly name: "operator"; readonly ty: "address"; }, { readonly name: "voter"; readonly ty: "address"; }]; }; readonly initialize_validator: { readonly name: "initialize_validator"; readonly doc: "Initialize the validator account and give ownership to the signing account."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "consensus_pubkey"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "proof_of_possession"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "network_addresses"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "fullnode_addresses"; readonly ty: { readonly vector: "u8"; }; }]; }; readonly join_validator_set: { readonly name: "join_validator_set"; readonly doc: "This can only called by the operator of the validator/staking pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }]; }; readonly leave_validator_set: { readonly name: "leave_validator_set"; readonly doc: "Request to have `pool_address` leave the validator set. The validator is only actually removed from the set when\nthe next epoch starts.\nThe last validator in the set cannot leave. This is an edge case that should never happen as long as the network\nis still operational.\n\nCan only be called by the operator of the validator/staking pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }]; }; readonly reactivate_stake: { readonly name: "reactivate_stake"; readonly doc: "Move `amount` of coins from pending_inactive to active."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "amount"; readonly ty: "u64"; }]; }; readonly rotate_consensus_key: { readonly name: "rotate_consensus_key"; readonly doc: "Rotate the consensus key of the validator, it'll take effect in next epoch."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }, { readonly name: "new_consensus_pubkey"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "proof_of_possession"; readonly ty: { readonly vector: "u8"; }; }]; }; readonly set_delegated_voter: { readonly name: "set_delegated_voter"; readonly doc: "Allows an owner to change the delegated voter of the stake pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "new_delegated_voter"; readonly ty: "address"; }]; }; readonly set_operator: { readonly name: "set_operator"; readonly doc: "Allows an owner to change the operator of the stake pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "new_operator"; readonly ty: "address"; }]; }; readonly unlock: { readonly name: "unlock"; readonly doc: "Similar to unlock_with_cap but will use ownership capability from the signing account."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "amount"; readonly ty: "u64"; }]; }; readonly update_network_and_fullnode_addresses: { readonly name: "update_network_and_fullnode_addresses"; readonly doc: "Update the network and full node addresses of the validator. This only takes effect in the next epoch."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }, { readonly name: "new_network_addresses"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "new_fullnode_addresses"; readonly ty: { readonly vector: "u8"; }; }]; }; readonly withdraw: { readonly name: "withdraw"; readonly doc: "Withdraw from `account`'s inactive stake."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "withdraw_amount"; readonly ty: "u64"; }]; }; }; /** All struct types with ability `key`. */ export declare const resources: { readonly AptosCoinCapabilities: "0x1::stake::AptosCoinCapabilities"; readonly OwnerCapability: "0x1::stake::OwnerCapability"; readonly StakePool: "0x1::stake::StakePool"; readonly ValidatorConfig: "0x1::stake::ValidatorConfig"; readonly ValidatorPerformance: "0x1::stake::ValidatorPerformance"; readonly ValidatorSet: "0x1::stake::ValidatorSet"; }; /** All struct types. */ export declare const structs: { readonly AddStakeEvent: "0x1::stake::AddStakeEvent"; readonly AptosCoinCapabilities: "0x1::stake::AptosCoinCapabilities"; readonly DistributeRewardsEvent: "0x1::stake::DistributeRewardsEvent"; readonly IncreaseLockupEvent: "0x1::stake::IncreaseLockupEvent"; readonly IndividualValidatorPerformance: "0x1::stake::IndividualValidatorPerformance"; readonly JoinValidatorSetEvent: "0x1::stake::JoinValidatorSetEvent"; readonly LeaveValidatorSetEvent: "0x1::stake::LeaveValidatorSetEvent"; readonly OwnerCapability: "0x1::stake::OwnerCapability"; readonly ReactivateStakeEvent: "0x1::stake::ReactivateStakeEvent"; readonly RegisterValidatorCandidateEvent: "0x1::stake::RegisterValidatorCandidateEvent"; readonly RotateConsensusKeyEvent: "0x1::stake::RotateConsensusKeyEvent"; readonly SetOperatorEvent: "0x1::stake::SetOperatorEvent"; readonly StakePool: "0x1::stake::StakePool"; readonly UnlockStakeEvent: "0x1::stake::UnlockStakeEvent"; readonly UpdateNetworkAndFullnodeAddressesEvent: "0x1::stake::UpdateNetworkAndFullnodeAddressesEvent"; readonly ValidatorConfig: "0x1::stake::ValidatorConfig"; readonly ValidatorInfo: "0x1::stake::ValidatorInfo"; readonly ValidatorPerformance: "0x1::stake::ValidatorPerformance"; readonly ValidatorSet: "0x1::stake::ValidatorSet"; readonly WithdrawStakeEvent: "0x1::stake::WithdrawStakeEvent"; }; /** * Validator lifecycle: * 1. Prepare a validator node set up and call stake::initialize_validator * 2. Once ready to deposit stake (or have funds assigned by a staking service in exchange for ownership capability), * call stake::add_stake (or *_with_cap versions if called from the staking service) * 3. Call stake::join_validator_set (or _with_cap version) to join the active validator set. Changes are effective in * the next epoch. * 4. Validate and gain rewards. The stake will automatically be locked up for a fixed duration (set by governance) and * automatically renewed at expiration. * 5. At any point, if the validator operator wants to update the consensus key or network/fullnode addresses, they can * call stake::rotate_consensus_key and stake::update_network_and_fullnode_addresses. Similar to changes to stake, the * changes to consensus key/network/fullnode addresses are only effective in the next epoch. * 6. Validator can request to unlock their stake at any time. However, their stake will only become withdrawable when * their current lockup expires. This can be at most as long as the fixed lockup duration. * 7. After exiting, the validator can either explicitly leave the validator set by calling stake::leave_validator_set * or if their stake drops below the min required, they would get removed at the end of the epoch. * 8. Validator can always rejoin the validator set by going through steps 2-3 again. * 9. An owner can always switch operators by calling stake::set_operator. * 10. An owner can always switch designated voter by calling stake::set_designated_voter. */ export declare const moduleDefinition: { readonly errorCodes: { readonly "1": { readonly name: "ELOCK_TIME_TOO_SHORT"; readonly doc: "Lockup period is shorter than required."; }; readonly "2": { readonly name: "EWITHDRAW_NOT_ALLOWED"; readonly doc: "Withdraw not allowed, the stake is still locked."; }; readonly "3": { readonly name: "EVALIDATOR_CONFIG"; readonly doc: "Validator Config not published."; }; readonly "4": { readonly name: "ESTAKE_TOO_LOW"; readonly doc: "Not enough stake to join validator set."; }; readonly "5": { readonly name: "ESTAKE_TOO_HIGH"; readonly doc: "Too much stake to join validator set."; }; readonly "6": { readonly name: "EALREADY_ACTIVE_VALIDATOR"; readonly doc: "Account is already a validator or pending validator."; }; readonly "7": { readonly name: "ENOT_VALIDATOR"; readonly doc: "Account is not a validator."; }; readonly "8": { readonly name: "ELAST_VALIDATOR"; readonly doc: "Can't remove last validator."; }; readonly "9": { readonly name: "ESTAKE_EXCEEDS_MAX"; readonly doc: "Total stake exceeds maximum allowed."; }; readonly "10": { readonly name: "EALREADY_REGISTERED"; readonly doc: "Account is already registered as a validator candidate."; }; readonly "11": { readonly name: "ENO_COINS_TO_WITHDRAW"; readonly doc: "No coins in inactive state to withdraw from specified pool."; }; readonly "12": { readonly name: "ENOT_OPERATOR"; readonly doc: "Account does not have the right operator capability."; }; readonly "13": { readonly name: "ELOCK_TIME_TOO_LONG"; readonly doc: "Lockup period is longer than allowed."; }; readonly "14": { readonly name: "ENO_POST_GENESIS_VALIDATOR_SET_CHANGE_ALLOWED"; }; readonly "15": { readonly name: "EINVALID_PUBLIC_KEY"; readonly doc: "Invalid consensus public key"; }; readonly "16": { readonly name: "EINVALID_STAKE_AMOUNT"; readonly doc: "Invalid stake amount (usuaully 0)."; }; readonly "18": { readonly name: "EVALIDATOR_SET_TOO_LARGE"; readonly doc: "Validator set exceeds the limit"; }; readonly "19": { readonly name: "EVOTING_POWER_INCREASE_EXCEEDS_LIMIT"; readonly doc: "Voting power increase has exceeded the limit for this current epoch."; }; }; readonly functions: { readonly add_stake: { readonly name: "add_stake"; readonly doc: "Add `amount` of coins from the `account` owning the StakePool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "amount"; readonly ty: "u64"; }]; }; readonly increase_lockup: { readonly name: "increase_lockup"; readonly doc: "Similar to increase_lockup_with_cap but will use ownership capability from the signing account."; readonly ty_args: readonly []; readonly args: readonly []; }; readonly initialize_stake_owner: { readonly name: "initialize_stake_owner"; readonly doc: "Initialize the validator account and give ownership to the signing account\nexcept it leaves the ValidatorConfig to be set by another entity.\nNote: this triggers setting the operator and owner, set it to the account's address\nto set later."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "initial_stake_amount"; readonly ty: "u64"; }, { readonly name: "operator"; readonly ty: "address"; }, { readonly name: "voter"; readonly ty: "address"; }]; }; readonly initialize_validator: { readonly name: "initialize_validator"; readonly doc: "Initialize the validator account and give ownership to the signing account."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "consensus_pubkey"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "proof_of_possession"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "network_addresses"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "fullnode_addresses"; readonly ty: { readonly vector: "u8"; }; }]; }; readonly join_validator_set: { readonly name: "join_validator_set"; readonly doc: "This can only called by the operator of the validator/staking pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }]; }; readonly leave_validator_set: { readonly name: "leave_validator_set"; readonly doc: "Request to have `pool_address` leave the validator set. The validator is only actually removed from the set when\nthe next epoch starts.\nThe last validator in the set cannot leave. This is an edge case that should never happen as long as the network\nis still operational.\n\nCan only be called by the operator of the validator/staking pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }]; }; readonly reactivate_stake: { readonly name: "reactivate_stake"; readonly doc: "Move `amount` of coins from pending_inactive to active."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "amount"; readonly ty: "u64"; }]; }; readonly rotate_consensus_key: { readonly name: "rotate_consensus_key"; readonly doc: "Rotate the consensus key of the validator, it'll take effect in next epoch."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }, { readonly name: "new_consensus_pubkey"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "proof_of_possession"; readonly ty: { readonly vector: "u8"; }; }]; }; readonly set_delegated_voter: { readonly name: "set_delegated_voter"; readonly doc: "Allows an owner to change the delegated voter of the stake pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "new_delegated_voter"; readonly ty: "address"; }]; }; readonly set_operator: { readonly name: "set_operator"; readonly doc: "Allows an owner to change the operator of the stake pool."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "new_operator"; readonly ty: "address"; }]; }; readonly unlock: { readonly name: "unlock"; readonly doc: "Similar to unlock_with_cap but will use ownership capability from the signing account."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "amount"; readonly ty: "u64"; }]; }; readonly update_network_and_fullnode_addresses: { readonly name: "update_network_and_fullnode_addresses"; readonly doc: "Update the network and full node addresses of the validator. This only takes effect in the next epoch."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pool_address"; readonly ty: "address"; }, { readonly name: "new_network_addresses"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "new_fullnode_addresses"; readonly ty: { readonly vector: "u8"; }; }]; }; readonly withdraw: { readonly name: "withdraw"; readonly doc: "Withdraw from `account`'s inactive stake."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "withdraw_amount"; readonly ty: "u64"; }]; }; }; readonly resources: { readonly AptosCoinCapabilities: "0x1::stake::AptosCoinCapabilities"; readonly OwnerCapability: "0x1::stake::OwnerCapability"; readonly StakePool: "0x1::stake::StakePool"; readonly ValidatorConfig: "0x1::stake::ValidatorConfig"; readonly ValidatorPerformance: "0x1::stake::ValidatorPerformance"; readonly ValidatorSet: "0x1::stake::ValidatorSet"; }; readonly structs: { readonly AddStakeEvent: "0x1::stake::AddStakeEvent"; readonly AptosCoinCapabilities: "0x1::stake::AptosCoinCapabilities"; readonly DistributeRewardsEvent: "0x1::stake::DistributeRewardsEvent"; readonly IncreaseLockupEvent: "0x1::stake::IncreaseLockupEvent"; readonly IndividualValidatorPerformance: "0x1::stake::IndividualValidatorPerformance"; readonly JoinValidatorSetEvent: "0x1::stake::JoinValidatorSetEvent"; readonly LeaveValidatorSetEvent: "0x1::stake::LeaveValidatorSetEvent"; readonly OwnerCapability: "0x1::stake::OwnerCapability"; readonly ReactivateStakeEvent: "0x1::stake::ReactivateStakeEvent"; readonly RegisterValidatorCandidateEvent: "0x1::stake::RegisterValidatorCandidateEvent"; readonly RotateConsensusKeyEvent: "0x1::stake::RotateConsensusKeyEvent"; readonly SetOperatorEvent: "0x1::stake::SetOperatorEvent"; readonly StakePool: "0x1::stake::StakePool"; readonly UnlockStakeEvent: "0x1::stake::UnlockStakeEvent"; readonly UpdateNetworkAndFullnodeAddressesEvent: "0x1::stake::UpdateNetworkAndFullnodeAddressesEvent"; readonly ValidatorConfig: "0x1::stake::ValidatorConfig"; readonly ValidatorInfo: "0x1::stake::ValidatorInfo"; readonly ValidatorPerformance: "0x1::stake::ValidatorPerformance"; readonly ValidatorSet: "0x1::stake::ValidatorSet"; readonly WithdrawStakeEvent: "0x1::stake::WithdrawStakeEvent"; }; readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::stake"; readonly NAME: "stake"; }; //# sourceMappingURL=index.d.ts.map