ArciumStakingIdlType
ArciumStakingIdlType =
object
Program IDL in camelCase format in order to be used in JS/TS.
Note that this is only a type helper and is not the actual IDL. The original
IDL can be found at target/idl/arcium_staking.json.
Properties
accounts
accounts: [{
discriminator: [144,100,215,185,29,226,247,116];name:"clusterStakeState"; }, {discriminator: [165,137,123,165,71,68,208,96];name:"delegatedStakingAccount"; }, {discriminator: [110,23,213,100,7,45,1,162];name:"delegationMasterAccount"; }, {discriminator: [20,112,51,115,14,80,65,206];name:"mxeRecoveryStakeState"; }, {discriminator: [119,201,85,90,23,169,26,56];name:"primaryStakingAccount"; }, {discriminator: [197,149,223,199,86,73,227,77];name:"stakingPoolAccount"; }]
address
address:
"ArcStnN9zZZVB5WjgPhLHjYpY7Gb29mzb96ySsb1kxgq"
errors
errors: [{
code:6000;name:"lockupTooShort"; }, {code:6001;name:"stakeNotUnlocked"; }, {code:6002;name:"stakeNotInactive"; }, {code:6003;name:"stakeNotActive"; }, {code:6004;name:"rewardsNotClaimed"; }, {code:6005;name:"rewardsAlreadyClaimed"; }, {code:6006;name:"invalidAuthority"; }, {code:6007;name:"invalidMasterAccount"; }, {code:6008;name:"noDelegationTarget"; }, {code:6009;name:"selfDelegationTooLow"; }, {code:6010;name:"delegationTooLow"; }, {code:6011;name:"tooManyDelegations"; }, {code:6012;name:"epochNotPassed"; }, {code:6013;name:"invalidRewardParam"; }, {code:6014;name:"invalidClaim"; }, {code:6015;name:"invalidActivation"; }, {code:6016;name:"invalidMerge"; }, {code:6017;name:"invalidSplit"; }, {code:6018;name:"invalidOffset"; }, {code:6019;name:"primaryAccountAlreadyInUse"; }, {code:6020;msg:"Primary stake account is already bound to a node or recovery peer";name:"stakeAlreadyBound"; }, {code:6021;msg:"bind_primary_stake may only be invoked via CPI by the arcium program";name:"unauthorizedBinder"; }, {code:6022;name:"invalidPrimaryStakingAcc"; }, {code:6023;name:"invalidDeactivationEpoch"; }, {code:6024;name:"invalidNode"; }, {code:6025;name:"invalidCluster"; }, {code:6026;msg:"Invalid MT height";name:"invalidHeight"; }, {code:6027;msg:"Invalid MT leaf";name:"invalidLeaf"; }, {code:6028;msg:"MT tree is full";name:"treeFull"; }, {code:6029;msg:"Borsh serialization failed";name:"serializationFailed"; }, {code:6030;msg:"Preceding instruction in this transaction is not the expected one";name:"invalidPrecedingIx"; }, {code:6031;msg:"Delegation target is not bound to a node or recovery peer";name:"delegationTargetNotBound"; }, {code:6032;msg:"Delegation target's primary stake is not active";name:"delegationTargetNotActive"; }, {code:6033;msg:"Primary stake must be settled to the current epoch (finalize first) before changing pending stake";name:"primaryNotSettled"; }, {code:6034;msg:"Delegated stake removal has not matured on the primary yet (finalize the primary first)";name:"delegatedRemovalNotMatured"; }]
instructions
instructions: [{
accounts: [{name:"signer";signer:true;writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; };writable:true; }];args: [{name:"lockupEpochs";type: {defined: {name:"epoch"; }; }; }];discriminator: [40,225,112,226,120,36,194,77];name:"activatePrimaryStake"; }, {accounts: [{name:"from";signer:true;writable:true; }, {name:"fromTa";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"from"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"from"; }]; };writable:true; }, {address:"ARXwZkNAtzPfdcoqQiduJn8EPv9fKiDfGn2KyggyDrFs";name:"mint"; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; }; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; }; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }];args: [{name:"amount";type:"u64"; }, {name:"feeBasisPoints";type:"u16"; }];discriminator: [98,129,141,154,217,213,144,132];docs: ["Migration counterpart of `init_primary_stake`: creates a real-stake `PrimaryStakingAccount`","(`amount >= MIN_SELF_DELEGATION`) for a pre-existing (legacy) node / recovery peer, which","arcium's migration instructions then bind to it."];name:"addPrimaryStakeToLegacyAcc"; }, {accounts: [{name:"staker";signer:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"staker"; }]; };writable:true; }, {docs: ["The node / recovery-peer account this stake is being bound to. It must be the genuine","`ArxNode` / `RecoveryPeerAccount` PDA — validated here by re-deriving it from its seeds","under the arcium program id — AND be a signer. Because the PDA is off-curve, no keypair","can sign for it; the only way it's a signer is via `invoke_signed` by arcium (the only","program that can sign for a PDA derived under its own id). This proves the call came via","CPI from arcium's ownership-validated `init_arx_node` / `init_recovery_peer_account`. A","direct caller can't bypass it: an arcium-owned *keypair* is on-curve and fails the seed","derivation, and no other program can sign for an arcium PDA."];name:"bindingAuthority";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"arg";path:"binding"; }, {kind:"arg";path:"roleOffset"; }]; };signer:true; }];args: [{name:"binding";type: {defined: {name:"stakeBinding"; }; }; }, {name:"roleOffset";type:"u32"; }];discriminator: [30,59,99,83,36,204,73,11];name:"bindPrimaryStake"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"destination";writable:true; }, {name:"primaryAccOwner"; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"primaryAccOwner"; }]; };writable:true; }, {name:"delegatedStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; };writable:true; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"stakeOffset";type:"u128"; }, {name:"proof";type: {defined: {generics: [{kind:"const";value:"15"; }];name:"mtProof"; }; }; }, {name:"claims";type: {defined: {name:"rewardBatch"; }; }; }];discriminator: [219,66,235,92,40,196,34,62];name:"claimDelegatedStakeRewards"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"destination";writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; };writable:true; }];args: [{name:"proof";type: {defined: {generics: [{kind:"const";value:"15"; }];name:"mtProof"; }; }; }, {name:"claims";type: {defined: {name:"rewardBatch"; }; }; }];discriminator: [143,34,168,105,77,122,58,72];name:"claimPrimaryStakeRewards"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"signerAta";writable:true; }, {docs: ["Kept as an `UncheckedAccount` so that when the signer is *also* the delegation owner —","i.e. this is the same account as `delegation_master` — Anchor's duplicate-mutable-account","check doesn't reject the tx. When it's a distinct account it's deserialized, mutated and","written back by hand in the handler. The PDA is still address-validated via the seeds."];name:"withdrawalMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {name:"delegationMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"delegationOwner"; }]; };writable:true; }, {docs: ["recorded delegation authority, otherwise the wrong master account gets reallocated."];name:"delegationOwner"; }, {name:"userStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {address:"ARXwZkNAtzPfdcoqQiduJn8EPv9fKiDfGn2KyggyDrFs";name:"mint"; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; }; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; };writable:true; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }, {docs: ["Required iff the stake was ever delegated (`delegation_target.is_some()`); verified","in-handler to equal `delegation_target`. Read-only."];name:"primary";optional:true; }];args: [{name:"stakeOffset";type:"u128"; }];discriminator: [110,229,137,54,240,115,93,160];name:"closeDelegatedStake"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; };writable:true; }];args: [{name:"nodeOffset";type: {option:"u32"; }; }];discriminator: [167,197,174,44,77,12,254,165];name:"deactivatePrimaryStake"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"primaryAccOwner"; }, {name:"userStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {name:"primary";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"primaryAccOwner"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; };writable:true; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"stakeOffset";type:"u128"; }, {name:"lockupEpochs";type: {defined: {name:"epoch"; }; }; }];discriminator: [50,110,95,179,194,75,140,246];name:"delegateStake"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; }; }];args: [{name:"lockupEpochs";type: {defined: {name:"epoch"; }; }; }];discriminator: [15,193,152,70,232,21,138,236];name:"extendPrimaryLockup"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"primaryStakeOwner"; }, {name:"primaryStakeOwnerAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"primaryStakeOwner"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"const";value: [140,2,27,73,195,17,0,246,183,113,43,241,63,58,114,3,95,72,247,95,41,87,67,226,103,238,224,193,5,200,127,194]; }]; };writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"primaryStakeOwner"; }]; };writable:true; }, {docs: ["The Arcium node this primary stake account is bound to. Used both to verify the binding","(via `primary_staking_account` field) and to derive the cluster for the CPI."];name:"arxNodeAcc";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [65,114,120,78,111,100,101]; }, {kind:"arg";path:"nodeOffset"; }]; }; }, {docs: ["Arcium's `Cluster` account — the CPI writes here to zero out this node's","`current_total_rewards` after transferring the lamports to our pool."];name:"clusterAcc";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,117,115,116,101,114]; }, {kind:"arg";path:"clusterOffset"; }]; };writable:true; }, {docs: ["Arcium's `FeePool` — the source of the lamports we're settling."];name:"feePool";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [70,101,101,80,111,111,108]; }]; };writable:true; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; };writable:true; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"const";value: [140,2,27,73,195,17,0,246,183,113,43,241,63,58,114,3,95,72,247,95,41,87,67,226,103,238,224,193,5,200,127,194]; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; }; }, {docs: ["Stake-weighted reward tracking for this cluster. Managed by the staking program."];name:"clusterStakeState";pda: {seeds: [{kind:"const";value: [67,108,117,115,116,101,114,83,116,97,107,101,83,116,97,116,101]; }, {kind:"arg";path:"clusterOffset"; }]; };writable:true; }, {address:"Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";docs: ["The Arcium program, used as the CPI target for `claim_node_fees`."];name:"arciumProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"clusterOffset";type:"u32"; }, {name:"nodeOffset";type:"u32"; }];discriminator: [96,76,184,66,143,127,194,46];name:"finalizeEpochRewards"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"primaryStakeOwner"; }, {name:"primaryStakeOwnerAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"primaryStakeOwner"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"const";value: [140,2,27,73,195,17,0,246,183,113,43,241,63,58,114,3,95,72,247,95,41,87,67,226,103,238,224,193,5,200,127,194]; }]; };writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"primaryStakeOwner"; }]; };writable:true; }, {docs: ["The recovery peer this claim is for. Binding check ties the passed","`primary_stake_account` to this peer."];name:"recoveryPeer";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [82,101,99,111,118,101,114,121,80,101,101,114,65,99,99,111,117,110,116]; }, {kind:"arg";path:"peerOffset"; }]; }; }, {docs: ["The recovery cluster for this MXE — enumerated to find the peer's bitmap index and","count total peers on first rollover."];name:"recoveryCluster";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [82,101,99,111,118,101,114,121,67,108,117,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"arg";path:"mxeProgram"; }]; }; }, {docs: ["The MXE account whose `current_epoch_recovery_rewards` will be drained by the first","peer's CPI this epoch."];name:"mxe";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [77,88,69,65,99,99,111,117,110,116]; }, {kind:"arg";path:"mxeProgram"; }]; };writable:true; }, {docs: ["FeePool — source of the lamports drained on first rollover."];name:"feePool";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [70,101,101,80,111,111,108]; }]; };writable:true; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; };writable:true; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"const";value: [140,2,27,73,195,17,0,246,183,113,43,241,63,58,114,3,95,72,247,95,41,87,67,226,103,238,224,193,5,200,127,194]; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; }; }, {name:"mxeRecoveryStakeState";pda: {seeds: [{kind:"const";value: [77,120,101,82,101,99,111,118,101,114,121,83,116,97,107,101,83,116,97,116,101]; }, {kind:"arg";path:"mxeProgram"; }]; };writable:true; }, {address:"Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";name:"arciumProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"mxeProgram";type:"pubkey"; }, {name:"peerOffset";type:"u32"; }];discriminator: [115,214,211,208,219,224,112,95];name:"finalizeRecoveryEpochRewards"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; };writable:true; }, {address:"ARXwZkNAtzPfdcoqQiduJn8EPv9fKiDfGn2KyggyDrFs";name:"mint"; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {address:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";name:"associatedTokenProgram"; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }];args: [];discriminator: [220,59,207,236,108,250,47,100];name:"init"; }, {accounts: [{name:"payer";signer:true;writable:true; }, {name:"clusterStakeState";pda: {seeds: [{kind:"const";value: [67,108,117,115,116,101,114,83,116,97,107,101,83,116,97,116,101]; }, {kind:"arg";path:"clusterOffset"; }]; };writable:true; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"clusterOffset";type:"u32"; }];discriminator: [11,113,207,30,123,218,94,242];name:"initClusterStakeState"; }, {accounts: [{name:"from";signer:true;writable:true; }, {name:"fromAta";writable:true; }, {name:"masterStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"from"; }]; };writable:true; }, {name:"userStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {address:"ARXwZkNAtzPfdcoqQiduJn8EPv9fKiDfGn2KyggyDrFs";name:"mint"; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; }; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }];args: [{name:"stakeOffset";type:"u128"; }, {name:"amount";type:"u64"; }];discriminator: [70,104,72,101,170,111,124,47];name:"initDelegatedStakeAcc"; }, {accounts: [{name:"payer";signer:true;writable:true; }, {name:"mxeRecoveryStakeState";pda: {seeds: [{kind:"const";value: [77,120,101,82,101,99,111,118,101,114,121,83,116,97,107,101,83,116,97,116,101]; }, {kind:"arg";path:"mxeProgram"; }]; };writable:true; }, {address:"Sysvar1nstructions1111111111111111111111111";docs: ["Instructions sysvar — used by the handler to verify the preceding instruction is","`arcium::init_mxe_part2` for the same `mxe_program`. This replaces what would have","been a direct CPI from `init_mxe_part2` (dropped because it pushed `InitMXEPart2`'s","stack frame past the 4KB BPF limit — see comments in `arcium::instructions::mxe`)."];name:"instructionsSysvar"; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"mxeProgram";type:"pubkey"; }];discriminator: [1,101,36,48,84,112,246,178];name:"initMxeRecoveryStakeState"; }, {accounts: [{name:"from";signer:true;writable:true; }, {name:"fromTa";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"from"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"from"; }]; };writable:true; }, {address:"ARXwZkNAtzPfdcoqQiduJn8EPv9fKiDfGn2KyggyDrFs";name:"mint"; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; }; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; }; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }];args: [{name:"amount";type:"u64"; }, {name:"feeBasisPoints";type:"u16"; }];discriminator: [94,143,48,229,76,163,156,12];name:"initPrimaryStake"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"masterStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"owner"; }]; };writable:true; }, {name:"owner"; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [];discriminator: [148,195,79,88,168,94,72,182];name:"initStakeMasterAcc"; }, {accounts: [{name:"delegationAuthority";signer:true;writable:true; }, {name:"withdrawalAuthority"; }, {name:"delegationMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"delegationAuthority"; }]; };writable:true; }, {name:"withdrawalMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"withdrawalAuthority"; }]; };writable:true; }, {name:"stakeAccToKeep";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffsetKeep"; }]; };writable:true; }, {name:"stakeAccToClose";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffsetClose"; }]; };writable:true; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"stakeOffsetKeep";type:"u128"; }, {name:"stakeOffsetClose";type:"u128"; }];discriminator: [29,112,122,209,215,222,210,210];name:"mergeDelegatedStakeAccount"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"signerTa";writable:true; }, {name:"primaryStakeAccount";pda: {seeds: [{kind:"const";value: [80,114,105,109,97,114,121,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {address:"ARXwZkNAtzPfdcoqQiduJn8EPv9fKiDfGn2KyggyDrFs";name:"mint"; }, {name:"poolAccount";pda: {seeds: [{kind:"const";value: [83,116,97,107,105,110,103,80,111,111,108,65,99,99,111,117,110,116]; }]; }; }, {name:"poolAta";pda: {program: {kind:"const";value: [140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]; };seeds: [{kind:"account";path:"poolAccount"; }, {kind:"const";value: [6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]; }, {kind:"account";path:"mint"; }]; };writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; }; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }, {address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";name:"tokenProgram"; }];args: [{name:"diff";type:"i64"; }];discriminator: [137,255,89,82,234,74,248,245];name:"modifyPrimaryStake"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"oldDelegationMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {name:"userStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {name:"newDelegationMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"newDelegator"; }]; };writable:true; }, {docs: ["checks"];name:"newDelegator"; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"stakeOffset";type:"u128"; }];discriminator: [136,63,130,110,201,182,66,34];name:"setDelegationAuthority"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"oldWithdrawalMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"signer"; }]; };writable:true; }, {name:"userStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {name:"newWithdrawalMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"newWithdrawer"; }]; };writable:true; }, {docs: ["checks"];name:"newWithdrawer"; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"stakeOffset";type:"u128"; }];discriminator: [2,250,241,96,55,170,121,42];name:"setWithdrawalAuthority"; }, {accounts: [{name:"delegationAuthority";signer:true;writable:true; }, {name:"withdrawalAuthority"; }, {name:"delegationMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"delegationAuthority"; }]; };writable:true; }, {name:"withdrawalMaster";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,105,111,110,77,97,115,116,101,114,65,99,99,111,117,110,116]; }, {kind:"account";path:"withdrawalAuthority"; }]; };writable:true; }, {name:"oldStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {name:"newStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffsetNew"; }]; };writable:true; }, {address:"11111111111111111111111111111111";name:"systemProgram"; }];args: [{name:"stakeOffset";type:"u128"; }, {name:"stakeOffsetNew";type:"u128"; }, {name:"newAccBalance";type:"u64"; }];discriminator: [191,188,48,128,187,99,18,141];name:"splitDelegatedStakeAccount"; }, {accounts: [{name:"signer";signer:true;writable:true; }, {name:"userStakeAccount";pda: {seeds: [{kind:"const";value: [68,101,108,101,103,97,116,101,100,83,116,97,107,105,110,103,65,99,99,111,117,110,116]; }, {kind:"arg";path:"stakeOffset"; }]; };writable:true; }, {docs: ["comparing it to the delegation target inside the instruction code."];name:"primary";writable:true; }, {name:"clock";pda: {program: {kind:"const";value: [146,111,9,170,109,72,125,226,216,140,55,106,22,29,7,127,176,129,11,19,35,107,124,118,71,160,112,40,3,250,93,137]; };seeds: [{kind:"const";value: [67,108,111,99,107,65,99,99,111,117,110,116]; }]; };writable:true; }];args: [{name:"stakeOffset";type:"u128"; }];discriminator: [49,132,245,247,97,129,220,101];name:"undelegateStake"; }]
metadata
metadata:
object
| Name | Type |
|---|---|
description | "Created with Anchor" |
name | "arciumStaking" |
spec | "0.1.0" |
version | "0.1.0" |
types
types: [{
name:"activation";type: {fields: [{docs: ["epoch for the cluster was activated. Epoch::INFINITY if inactive."];name:"activationEpoch";type: {defined: {name:"epoch"; }; }; }, {docs: ["epoch for the cluster to be deactivated. Epoch::INFINITY if none."];name:"deactivationEpoch";type: {defined: {name:"epoch"; }; }; }];kind:"struct"; }; }, {name:"arxNode";type: {fields: [{docs: ["X25519 public key. MUST BE AT byte index 8 - 40"];name:"x25519Pubkey";type: {array: ["u8",32]; }; }, {name:"primaryStakingAccount";type:"pubkey"; }, {name:"metadata";type: {defined: {name:"nodeMetadata"; }; }; }, {name:"config";type: {defined: {name:"arxNodeConfig"; }; }; }, {docs: ["The offsets of the cluster the node is a member of."];name:"clusterMembership";type: {defined: {name:"clusterMembership"; }; }; }, {name:"cuCapacityClaim";type:"u64"; }, {name:"isActive";type:"bool"; }, {docs: ["BLS public key for this node (64 bytes compressed G2 point for alt-bn128)"];name:"blsPubkey";type: {defined: {name:"bn254g2blsPublicKey"; }; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {name:"arxNodeConfig";type: {fields: [{docs: ["Admin key for node management operations"];name:"authority";type:"pubkey"; }, {docs: ["Key used to sign computation callbacks - separated for operational security"];name:"callbackAuthority";type:"pubkey"; }];kind:"struct"; }; }, {name:"authority";type: {fields: [{name:"delegationAuthority";type:"pubkey"; }, {name:"withdrawalAuthority";type:"pubkey"; }];kind:"struct"; }; }, {name:"bn254g2blsPublicKey";type: {fields: [{array: ["u8",64]; }];kind:"struct"; }; }, {docs: ["An account storing the current network epoch"];name:"clockAccount";type: {fields: [{name:"startEpoch";type: {defined: {name:"epoch"; }; }; }, {name:"currentEpoch";type: {defined: {name:"epoch"; }; }; }, {name:"startEpochTimestamp";type: {defined: {name:"timestamp"; }; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {name:"cluster";type: {fields: [{name:"tdInfo";type: {option: {defined: {name:"nodeMetadata"; }; }; }; }, {name:"authority";type: {option:"pubkey"; }; }, {name:"clusterSize";type:"u16"; }, {name:"activation";type: {defined: {name:"activation"; }; }; }, {name:"maxCapacity";type:"u64"; }, {docs: ["The price of compute units in this cluster, in micro-lamports (millionths of a lamport)."];name:"cuPrice";type:"u64"; }, {docs: ["The proposals for the cu price proposals in the next epoch, in micro-lamports.","Index 0 is always the current price, we allow `MAX_FEE_PROPS` at most."];name:"cuPriceProposals";type: {array: ["u64",32]; }; }, {docs: ["The epoch this cluster was last updated.","Used to determine if the cluster needs to be updated."];name:"lastUpdatedEpoch";type: {defined: {name:"epoch"; }; }; }, {name:"nodes";type: {vec: {defined: {name:"nodeRef"; }; }; }; }, {name:"pendingNodes";type: {vec:"u32"; }; }, {docs: ["BLS public key for the cluster (64 bytes compressed G2 point for alt-bn128)","Set only when all nodes have submitted and agreed on the aggregated pubkey"];name:"blsPublicKey";type: {defined: {generics: [{kind:"type";type: {defined: ...; }; }];name:"setUnset"; }; }; }, {docs: ["PDA bump. Declared by hand rather than via the `#[bump]` macro (which appends the bump","as the *final* struct field) so it keeps its original offset right after","`bls_public_key`. Everything below is appended *after* the bump, which means the byte","layout of every field up to and including `bump` is identical to the pre-staking","`Cluster` — old deserializers (including external user programs that read this account)","decode the original prefix and harmlessly ignore the trailing staking fields."];name:"bump";type:"u8"; }, {docs: ["Running total of computation rewards accrued during `rewards_epoch`. Drained to zero","by `claim_node_fees` when nodes settle via `finalize_epoch_rewards`."];name:"currentEpochTotalRewards";type:"u64"; }, {docs: ["The epoch that `current_epoch_total_rewards` belongs to. If the clock has advanced","past this epoch and `current_epoch_total_rewards > 0`, the rewards are stale","(nodes didn't settle in time) — new accruals are silently skipped until nodes","finalize, which punishes lazy operators."];name:"rewardsEpoch";type: {defined: {name:"epoch"; }; }; }, {docs: ["The selector for leader."];name:"leaderSelector";type: {defined: {name:"leaderSelector"; }; }; }];kind:"struct"; }; }, {name:"clusterMembership";type: {kind:"enum";variants: [{name:"inactive"; }, {fields: ["u32"];name:"active"; }, {fields: ["u32"];name:"proposed"; }]; }; }, {docs: ["Tracks per-cluster staking totals for stake-weighted reward distribution.","","One PDA per cluster, owned by the staking program. Created when a cluster first needs","reward settlement (or at cluster activation time). Fields track a two-phase claiming","round for each epoch:","","1. **Accrual** — during the epoch, computation fees accumulate on","`Cluster.current_epoch_total_rewards` (in the arcium program).","2. **Settlement** — when the epoch ends, nodes finalize one by one:","- The first node to finalize CPIs into `claim_node_fees` which drains the cluster pot and","writes the amount into `total_rewards`.","- Each node computes `my_share = total_rewards * my_stake / prev_epoch_total_stake`, inserts","a RewardClaim.","- Each node reports its post-maturation stake into `curr_epoch_total_stake` for the next","round.","- Once all nodes have claimed (bitmap full), `curr_epoch_total_stake` is promoted to","`prev_epoch_total_stake` and the round resets.","","Rollover into a new epoch is gated on `claimed_bitmap.count_ones() == num_nodes` — the","next round can't start settling until every node in the previous round has claimed.","Without that gate a missing claimant would leave `curr_epoch_total_stake` short and","let the present claimants over-divide the pot (pool would run dry on withdraw).","While the gate is held, laggards (nodes whose bit isn't yet set) are still allowed to","finalize for the stuck `epoch` — their call just doesn't advance `epoch`. Finalize is","permissionless, so any caller can unstick a laggard by poking finalize for them."];name:"clusterStakeState";type: {fields: [{name:"inner";type: {defined: {name:"stakeStateTracker"; }; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {generics: [{kind:"const";name:"height";type:"usize"; }];name:"compressedMt";type: {fields: [{name:"leafCount";type:"u16"; }, {name:"nodes";type: {array: [{defined: {name:"hash"; }; }, {generic:"height"; }]; }; }, {name:"root";type: {defined: {name:"hash"; }; }; }, {name:"batchingRate";type:"u8"; }];kind:"struct"; }; }, {name:"delegatedStakingAccount";type: {fields: [{name:"authority";type: {defined: {name:"authority"; }; }; }, {name:"delegationTarget";type: {option:"pubkey"; }; }, {docs: ["stake amount in this account"];name:"stake";type:"u64"; }, {name:"lockup";type: {defined: {name:"lockup"; }; }; }, {docs: ["whether the rewards for this stake for the period between","activation and deactivation have been claimed"];name:"claimedRewards";type: {defined: {name:"epoch"; }; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {docs: ["Tracks the offsets of the [DelegatedStakingAccount]s over which a user has authority.","","# Note","","We cap the number of accounts to [MAX_STAKE_ACCOUNTS] (which is set to 128 for now, but this can","be increased if necessary)."];name:"delegationMasterAccount";type: {fields: [{name:"accounts";type: {vec: {defined: {name:"ownedStakingAccReference"; }; }; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {docs: ["The network epoch"];name:"epoch";type: {fields: ["u64"];kind:"struct"; }; }, {name:"feePool";type: {fields: [{name:"bump";type:"u8"; }];kind:"struct"; }; }, {name:"hash";type: {fields: [{array: ["u8",32]; }];kind:"struct"; }; }, {docs: ["The computation chosen by a node to be executed when the node is leader."];name:"leaderChoice";type: {fields: [{docs: ["Computation_offset of the chosen computation."];name:"offset";type:"u64"; }, {docs: ["The index of the max_heap the computation is in inside the MemPool's Circular Buffer.","This is the physical index, not the logical one."];name:"slotIdx";type:"u16"; }];kind:"struct"; }; }, {docs: ["The information about a node."];name:"leaderInfo";type: {fields: [{docs: ["The node's stake."];name:"stake";type:"u64"; }, {docs: ["The number + 1 of times the node has been chosen as leader in this cycle.","0 if the stake is unset.","This way works well for performance."];name:"count";type:"u64"; }, {docs: ["The last time the node has been chosen as leader."];name:"lastCounterPlusOne";type:"u64"; }, {docs: ["The choice of that node."];name:"choice";type: {defined: {name:"leaderChoice"; }; }; }];kind:"struct"; }; }, {docs: ["To select a Leader.","Uses the greatest divisors method: https://en.wikipedia.org/wiki/D%27Hondt_method"];name:"leaderSelector";type: {fields: [{docs: ["The last epoch the staking was set."];name:"stakingEpoch";type: {defined: {name:"epoch"; }; }; }, {docs: ["The information about each node."];name:"info";type: {vec: {defined: {name:"leaderInfo"; }; }; }; }];kind:"struct"; }; }, {name:"lockup";type: {fields: [{docs: ["epoch at which the stake was activated. Epoch::MAX if inactive."];name:"activationEpoch";type: {defined: {name:"epoch"; }; }; }, {docs: ["epoch from which on active stake can be deactivated. Epoch::MAX if inactive"];name:"unlockEpoch";type: {defined: {name:"epoch"; }; }; }, {docs: ["epoch the stake was deactivated, Epoch::MAX if still active"];name:"deactivationEpoch";type: {defined: {name:"epoch"; }; }; }];kind:"struct"; }; }, {generics: [{kind:"const";name:"height";type:"usize"; }];name:"mtProof";type: {fields: [{name:"leafIndex";type:"u16"; }, {name:"opening";type: {array: [{defined: {name:"hash"; }; }, {generic:"height"; }]; }; }];kind:"struct"; }; }, {docs: ["A MPC Execution Environment."];name:"mxeAccount";type: {fields: [{docs: ["`cluster` used to be Option<u32>, so we need to add a padding byte for backwards","compatibility."];name:"padding";type:"u8"; }, {docs: ["The cluster executing the MXE."];name:"cluster";type:"u32"; }, {docs: ["The offset used for the keygen computation account.","Stored so requeue_mxe_keygen can find the computation account."];name:"keygenOffset";type:"u64"; }, {docs: ["The offset used for the key recovery init computation account.","Stored so queue_key_recovery_init can find the computation account."];name:"keyRecoveryInitOffset";type:"u64"; }, {docs: ["The program ID of the program that this MXE is associated with. Needed so that when we","index this account offchain we can find out what program it is associated with."];name:"mxeProgramId";type:"pubkey"; }, {docs: ["The management authority of the MXE."];name:"authority";type: {option:"pubkey"; }; }, {docs: ["The utility pubkeys, consisting of","- x25519 pubkey (32 bytes), used for key exchange","- ed25519 verifying key (32 bytes), used for signature verification","- ElGamal pubkey (32 bytes), used for c-spl","- ElGamal pubkey validity proof (64 bytes), used for c-spl"];name:"utilityPubkeys";type: {defined: {generics: [{kind:"type";type: {defined: ...; }; }];name:"setUnset"; }; }; }, {name:"lutOffsetSlot";type:"u64"; }, {docs: ["The offsets of all [ComputationDefinitionAccount]s of this MXE."];name:"computationDefinitions";type: {vec:"u32"; }; }, {docs: ["The status of this MXE (`Active` or `Migration`)."];name:"status";type: {defined: {name:"mxeStatus"; }; }; }, {docs: ["PDA bump. Declared by hand rather than via the `#[bump]` macro (which appends the bump","as the *final* struct field) so it keeps its original offset right after `status`.","The recovery-reward fields below are appended *after* the bump, leaving the byte layout","of every field up to and including `bump` identical to the pre-staking `MXEAccount` —","old deserializers (including external user programs) decode the original prefix and","harmlessly ignore the trailing fields."];name:"bump";type:"u8"; }, {docs: ["Running total of recovery-peer rewards accrued during `recovery_rewards_epoch`.","Fed by the 20% slice of every computation/failure fee processed on this MXE;","drained to zero by `claim_recovery_peer_fees` when recovery peers settle via","`arcium_staking::finalize_recovery_epoch_rewards`. Same stale-epoch guard as","`Cluster::current_epoch_total_rewards` — if peers don't settle before the epoch","rolls over, new accruals are silently skipped until the pot is drained."];name:"currentEpochRecoveryRewards";type:"u64"; }, {docs: ["Epoch that `current_epoch_recovery_rewards` is attributed to. Compared against the","executing cluster's `last_updated_epoch` (the same proxy used by cluster rewards) to","decide whether a new accrual is for the current round or a stale one."];name:"recoveryRewardsEpoch";type: {defined: {name:"epoch"; }; }; }];kind:"struct"; }; }, {name:"mxeRecoveryStakeState";type: {fields: [{name:"inner";type: {defined: {name:"stakeStateTracker"; }; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {docs: ["The status of an MXE."];name:"mxeStatus";type: {kind:"enum";variants: [{name:"active"; }, {name:"migration"; }]; }; }, {docs: ["location as [ISO 3166-1 alpha-2](https://www.iso.org/iso-3166-country-codes.html) country code"];name:"nodeMetadata";type: {fields: [{docs: ["`Ipv4Addr`, represented by its 4 octets"];name:"ip";type: {array: ["u8",4]; }; }, {docs: ["Needed for MPC protocol"];name:"peerId";type: {array: ["u8",32]; }; }, {name:"location";type:"u8"; }];kind:"struct"; }; }, {docs: ["A reference to a node in the cluster.","The offset is to derive the Node Account."];name:"nodeRef";type: {fields: [{name:"offset";type:"u32"; }, {docs: ["Reserved padding occupying the 8 bytes that previously held `current_total_rewards: u64`","(per-node reward tracking, now superseded by the cluster-level","`current_epoch_total_rewards`). We keep these bytes rather than shrinking `NodeRef`","because `nodes: Vec<NodeRef>` sits in the *middle* of the `Cluster` struct: removing the","field would change the encoded element size and desync the borsh decode of every field","after `nodes` for already-deployed accounts and external deserializers. Do not repurpose","without a full account migration."];name:"padding";type: {array: ["u8",8]; }; }, {name:"vote";type:"u8"; }];kind:"struct"; }; }, {docs: ["Reference to a delegated staking account owned by the user"];name:"ownedStakingAccReference";type: {fields: [{name:"offset";type:"u128"; }, {name:"delegationAuthority";type:"bool"; }, {name:"withdrawalAuthority";type:"bool"; }];kind:"struct"; }; }, {docs: ["Aggregated queue of pending stake deltas, one slot per epoch of activation delay.","","New changes are enqueued into the last slot (matures in N epochs). Each call to","`finalize_epoch_rewards` rotates forward: slot 0 gets applied and dropped, slot 1 becomes","slot 0, and a fresh zero slot takes the back.","","We aggregate net deltas per slot instead of tracking individual `StakeDiff` entries","because nothing in the program ever needed per-entry identity — the only distinction that","mattered was primary vs delegated, and we split that at enqueue time into two fields."];name:"pendingStake";type: {fields: [{name:"slots";type: {array: [{defined: {name:"pendingStakeSlot"; }; },2]; }; }];kind:"struct"; }; }, {name:"pendingStakeSlot";type: {fields: [{name:"primaryDelta";type:"i64"; }, {name:"delegatedDelta";type:"i64"; }];kind:"struct"; }; }, {name:"primaryStakingAccount";type: {fields: [{docs: ["Total primary stake amount in this account."];name:"primaryStake";type:"u64"; }, {name:"delegatedStake";type:"u64"; }, {name:"lockup";type: {defined: {name:"lockup"; }; }; }, {name:"claimedRewards";type: {defined: {name:"epoch"; }; }; }, {name:"rewardsMt";type: {defined: {generics: [{kind:"const";value:"15"; }];name:"compressedMt"; }; }; }, {name:"currentEpoch";type: {defined: {name:"epoch"; }; }; }, {name:"feeBasisPoints";type:"u16"; }, {docs: ["Exclusive binding of this stake to an on-chain role. Set exactly once (via","`bind_primary_stake`) from the arcium program's `init_arx_node` or","`init_recovery_peer_account`. `None` means the stake is free; `Some` locks it to a","specific node or recovery peer so the same stake can't back two roles at once."];name:"binding";type: {option: {defined: {name:"stakeBinding"; }; }; }; }, {docs: ["Aggregated stake-delta queue. Each slot holds net primary and net delegated deltas;","no per-invoker identity is tracked because nothing in the program cares about it —","every consumer aggregates anyway."];name:"pending";type: {defined: {name:"pendingStake"; }; }; }, {name:"rewardBuffer";type: {vec: {defined: {name:"rewardClaim"; }; }; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {name:"recoveryClusterAccount";repr: {kind:"c"; };serialization:"bytemuck";type: {fields: [{docs: ["The offsets of nodes in our key recovery cluster. 0 means null in this context.","DO NOT PUT ANYTHING BEFORE THE RECOVERY_PEERS FIELD, IT'S EXPECTED TO BE AT OFFSET 8."];name:"recoveryPeers";type: {array: ["u32",100]; }; }, {name:"recoveryKeyMaterial";type: {defined: {name:"recoveryKeyMaterial"; }; }; }, {name:"padding";type: {array: ["u8",2]; }; }, {name:"bump";type:"u8"; }];kind:"struct"; }; }, {name:"recoveryKeyMaterial";repr: {kind:"c"; };serialization:"bytemuck";type: {fields: [{name:"nonce";type: {array: ["u8",16]; }; }, {name:"encryptedMxeKeys";type: {array: [{array: ["u8",32]; },13]; }; }, {name:"keyMaterialHash";type: {array: ["u8",32]; }; }, {name:"recoveryKeyshares";type: {array: [{array: [{array: ...; },5]; },100]; }; }, {name:"blsSig";type: {array: ["u8",64]; }; }, {name:"status";type:"u8"; }];kind:"struct"; }; }, {name:"recoveryPeerAccount";repr: {kind:"c"; };serialization:"bytemuck";type: {fields: [{name:"authority";type:"pubkey"; }, {docs: ["DO NOT PUT ANYTHING ELSE BEFORE THE X25519_PUBKEY FIELD, IT'S EXPECTED TO BE AT OFFSET 40."];name:"x25519Pubkey";type: {array: ["u8",32]; }; }, {docs: ["DO NOT PUT ANYTHING ELSE BEFORE THE PEER_OFFSET FIELD, IT'S EXPECTED TO BE AT OFFSET 72."];name:"peerOffset";type: {array: ["u8",4]; }; }, {docs: ["PDA bump. Declared by hand rather than via the `#[bump]` macro (which appends the bump","as the *final* struct field) so it keeps its original offset (76) right after","`peer_offset`. `primary_stake_account` is appended *after* the bump, leaving the byte","layout of every field up to and including `bump` identical to the pre-staking","`RecoveryPeerAccount` — old deserializers decode the original prefix and harmlessly","ignore the trailing field."];name:"bump";type:"u8"; }, {docs: ["The `PrimaryStakingAccount` (owned by `arcium_staking`) this recovery peer is bound","to. Enforced at init time via an owner check so every recovery peer has skin in the","game — the same stake-first model we already apply to `ArxNode`. Stored here so","downstream instructions (and off-chain consumers) can look up the backing stake","without re-validating the chain of accounts. Appended after `bump` to preserve the","legacy on-chain layout (see the `bump` field comment)."];name:"primaryStakeAccount";type:"pubkey"; }];kind:"struct"; }; }, {docs: ["The reason this type exists is we mostly use RewardClaim as the input for leaves in the","MerkleTree. These leaves have to have a certain constant batching rate. Unfortunately Anchor","doesn't support defining array length based on a variable or constant for inputs, it has to be a","numeric. To avoid having to manually check everywhere we submit a batch of RewardClaims, we","define this type to have it in one place where we can apply our assert_size macro to make sure","it doesn't deviate from our defined constant using cargo test.","Other note: A simpler way to define this type would be","`type RewardBatch = [RewardClaim; 1];` but Anchor at runtime","thinks any RewardBatch it is all zeroes for whatever reason, so we do this."];name:"rewardBatch";type: {fields: [{name:"claims";type: {array: [{defined: {name:"rewardClaim"; }; },1]; }; }];kind:"struct"; }; }, {name:"rewardClaim";type: {fields: [{name:"totalRewards";type:"u64"; }, {name:"primaryStake";type:"u64"; }, {name:"delegatedStake";type:"u64"; }, {name:"epoch";type: {defined: {name:"epoch"; }; }; }];kind:"struct"; }; }, {docs: ["Utility struct to store a value that needs to be set by a certain number of participants (keys","in our case). Once all participants have set the value, the value is considered set and we only","store it once."];generics: [{kind:"type";name:"t"; }];name:"setUnset";type: {kind:"enum";variants: [{fields: [{generic:"t"; }];name:"set"; }, {fields: [{generic:"t"; }, {vec:"bool"; }];name:"unset"; }]; }; }, {docs: ["What a `PrimaryStakingAccount` is committed to. Set once via `bind_primary_stake` (CPI","from arcium) and thereafter immutable for the life of the account."];name:"stakeBinding";type: {kind:"enum";variants: [{fields: ["pubkey"];name:"node"; }, {fields: ["pubkey"];name:"recoveryPeer"; }]; }; }, {name:"stakeStateTracker";type: {fields: [{docs: ["Info about the cluster/mxe this state belongs to.","How many nodes are in the cluster or mxe and expected to claim before the round can","advance."];name:"numNodes";type:"u16"; }, {docs: ["Info about the staking state of the cluster or mxe in the current epoch.","Total stake of the cluster or mxe in the current epoch."];name:"totalStake";type:"u64"; }, {docs: ["Total rewards to distribute for the current claiming round. Set by the first","node's finalize CPI and read by all subsequent nodes."];name:"totalRewards";type:"u64"; }, {docs: ["The epoch this claiming round is for. Guards against double-finalize: a node can","only finalize when `staking_state.epoch == node's","primary_stake_account.current_epoch`."];name:"epoch";type: {defined: {name:"epoch"; }; }; }, {docs: ["State management fields","One bit per node (indexed by position in `cluster.nodes` or `mxe.recovery_peers`). Set when","that node has updated its stake and claimed its share."];name:"claimedBitmap";type:"u128"; }, {docs: ["Since each node individually reports its stake in a separate instruction.","Once all nodes have claimed, we can promote this to `total_stake`."];name:"totalStakeAccumulator";type:"u64"; }];kind:"struct"; }; }, {name:"stakingPoolAccount";type: {fields: [{name:"bump";type:"u8"; }];kind:"struct"; }; }, {name:"timestamp";type: {fields: [{name:"timestamp";type:"u64"; }];kind:"struct"; }; }, {name:"utilityPubkeys";type: {fields: [{name:"x25519Pubkey";type: {array: ["u8",32]; }; }, {name:"ed25519VerifyingKey";type: {array: ["u8",32]; }; }, {name:"elgamalPubkey";type: {array: ["u8",32]; }; }, {name:"pubkeyValidityProof";type: {array: ["u8",64]; }; }];kind:"struct"; }; }]