js-conflux-sdk
Version:
JavaScript Conflux Software Development Kit
111 lines • 2.61 kB
TypeScript
export = PoS;
/**
* Class contains pos RPC methods
* For the detail meaning of fields, please refer to the PoS RPC document:
* @class
*/
declare class PoS extends RPCMethodFactory {
static methods(): ({
method: string;
responseFormatter: any;
requestFormatters?: undefined;
} | {
method: string;
requestFormatters: any[];
responseFormatter: any;
})[];
/**
* Create PoS instance
* @param {import('../Conflux').Conflux} conflux The Conflux object
* @return {PoS} The PoS instance
*/
constructor(conflux: any);
}
declare namespace PoS {
export { PivotDecision, PoSStatus, VotePowerState, PoSAccountStatus, PoSAccount, PoSTransaction, Signature, PoSBlock, CommitteeNode, Election, CurrentCommittee, PoSCommittee, PoSReward, PoSEpochRewards };
}
import RPCMethodFactory = require("./index");
type PivotDecision = {
height: number;
blockHash: string;
};
/**
* PoS status
*/
type PoSStatus = {
latestCommitted: number;
epoch: number;
latestVoted: number;
latestTxNumber: number;
pivotDecision: PivotDecision;
};
type VotePowerState = {
endBlockNumber: number;
power: number;
};
type PoSAccountStatus = {
availableVotes: number;
forfeited: number;
inQueue: VotePowerState[];
outQueue: VotePowerState[];
locked: number;
unlocked: number;
forceRetired: number | null;
};
type PoSAccount = {
blockNumber: number;
status: PoSAccountStatus;
};
type PoSTransaction = {
hash: string;
blockHash: string;
from: string;
status: string;
type: string;
number: number;
timestamp: number | null;
blockNumber: number | null;
payload: any;
};
type Signature = {
votes: number;
account: string;
};
type PoSBlock = {
epoch: number;
height: number;
pivotDecision: PivotDecision;
round: number;
timestamp: number;
lastTxNumber: number;
signatures: Signature;
};
type CommitteeNode = {
votingPower: number;
address: string;
};
type Election = {
isFinalized: boolean;
startBlockNumber: number;
topElectingNodes: CommitteeNode[];
};
type CurrentCommittee = {
epochNumber: number;
quorumVotingPower: number;
totalVotingPower: number;
nodes: CommitteeNode[];
};
type PoSCommittee = {
currentCommittee: CurrentCommittee;
elections: Election[];
};
type PoSReward = {
reward: number;
posAddress: string;
powAddress: string;
};
type PoSEpochRewards = {
powEpochHash: string;
accountRewards: PoSReward[];
};
//# sourceMappingURL=pos.d.ts.map