client-aftermath-ts-sdk
Version:
Client Aftermath TypeScript SDK
155 lines • 5.01 kB
TypeScript
import { CoinType } from "../..";
import { ApiEventsBody, Balance, Event, Object, Percentage, Timestamp, ObjectId, SuiAddress, TransactionDigest, ExternalFee } from "../../general/types/generalTypes";
export interface ValidatorConfigObject extends Object {
suiAddress: SuiAddress;
operationCapId: ObjectId;
fee: Percentage;
}
export interface ValidatorOperationCapObject extends Object {
authorizerValidatorAddress: SuiAddress;
}
export interface StakedSuiVaultStateObject extends Object {
atomicUnstakeSuiReservesTargetValue: Balance;
atomicUnstakeSuiReserves: Balance;
minAtomicUnstakeFee: bigint;
maxAtomicUnstakeFee: bigint;
totalRewardsAmount: Balance;
totalSuiAmount: Balance;
activeEpoch: bigint;
}
export interface StakeBalanceDynamicField {
objectId: ObjectId;
value: Balance;
}
export type SuiDelegatedStakeState = "Active" | "Pending" | "Unstaked";
export interface SuiDelegatedStake {
status: SuiDelegatedStakeState;
stakedSuiId: ObjectId;
stakeRequestEpoch: bigint;
stakeActiveEpoch: bigint;
principal: Balance;
estimatedReward?: Balance | undefined;
validatorAddress: SuiAddress;
stakingPool: SuiAddress;
}
export declare const isSuiDelegatedStake: (stake: StakingPosition | SuiDelegatedStake) => stake is SuiDelegatedStake;
export interface StakingApyDataPoint {
timestamp: Timestamp;
apy: number;
}
export type StakingApyTimeframeKey = "1W" | "1M" | "3M" | "6M" | "1Y" | "ALL";
export type StakeEvent = StakedEvent;
export type UnstakeEvent = UnstakeRequestedEvent | UnstakedEvent;
export interface StakedEvent extends Event {
stakedSuiId: ObjectId;
suiId: ObjectId;
staker: SuiAddress;
validatorAddress: SuiAddress;
epoch: bigint;
suiStakeAmount: Balance;
validatorFee: number;
isRestaked: boolean;
afSuiId: ObjectId;
afSuiAmount: Balance;
referrer?: SuiAddress;
}
export interface UnstakeRequestedEvent extends Event {
afSuiId: ObjectId;
providedAfSuiAmount: Balance;
requester: SuiAddress;
epoch: bigint;
}
export interface UnstakedEvent extends Event {
afSuiId: ObjectId;
providedAfSuiAmount: Balance;
suiId: ObjectId;
returnedSuiAmount: Balance;
requester: SuiAddress;
epoch: bigint;
}
export declare const isStakeEvent: (event: StakeEvent | UnstakeEvent) => event is StakedEvent;
export declare const isUnstakeEvent: (event: StakeEvent | UnstakeEvent) => event is UnstakeEvent;
export interface EpochWasChangedEvent extends Event {
activeEpoch: bigint;
totalAfSuiSupply: Balance;
totalSuiRewardsAmount: Balance;
totalSuiAmount: Balance;
}
export type StakingPosition = StakePosition | UnstakePosition;
export interface StakePosition {
stakedSuiId: ObjectId;
suiId: ObjectId;
staker: SuiAddress;
validatorAddress: SuiAddress;
epoch: bigint;
suiStakeAmount: Balance;
validatorFee: number;
isRestaked: boolean;
afSuiId: ObjectId;
afSuiAmount: Balance;
timestamp: Timestamp | undefined;
txnDigest: TransactionDigest;
}
export interface UnstakePosition {
state: UnstakePositionState;
afSuiId: ObjectId;
providedAfSuiAmount: Balance;
requester: SuiAddress;
epoch: bigint;
suiId?: ObjectId;
returnedSuiAmount?: Balance;
timestamp: Timestamp | undefined;
txnDigest: TransactionDigest;
}
export type UnstakePositionState = "REQUEST" | "SUI_MINTED";
export declare const isStakePosition: (position: StakingPosition) => position is StakePosition;
export declare const isUnstakePosition: (position: StakingPosition) => position is UnstakePosition;
export interface ApiStakeBody {
walletAddress: SuiAddress;
suiStakeAmount: Balance;
validatorAddress: SuiAddress;
referrer?: SuiAddress;
externalFee?: ExternalFee;
isSponsoredTx?: boolean;
}
export interface ApiUnstakeBody {
walletAddress: SuiAddress;
afSuiUnstakeAmount: Balance;
isAtomic: boolean;
referrer?: SuiAddress;
externalFee?: ExternalFee;
isSponsoredTx?: boolean;
}
export interface ApiStakeStakedSuiBody {
walletAddress: SuiAddress;
stakedSuiIds: ObjectId[];
validatorAddress: SuiAddress;
referrer?: SuiAddress;
isSponsoredTx?: boolean;
}
export interface ApiUpdateValidatorFeeBody {
walletAddress: SuiAddress;
validatorOperationCapId: ObjectId;
newFeePercentage: Percentage;
isSponsoredTx?: boolean;
}
export interface ApiStakingPositionsBody {
walletAddress: SuiAddress;
cursor?: number;
limit?: number;
}
export interface ApiDelegatedStakesBody {
walletAddress: SuiAddress;
}
export interface ApiValidatorOperationCapsBody {
walletAddress: SuiAddress;
}
export type ApiStakingEventsBody = ApiEventsBody & {
walletAddress: SuiAddress;
};
export type AfSuiRouterPoolObject = StakedSuiVaultStateObject & {
afSuiCoinType: CoinType;
aftermathValidatorAddress: SuiAddress;
afSuiToSuiExchangeRate: number;
};
//# sourceMappingURL=stakingTypes.d.ts.map