Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pier_two/staking-ts",
"version": "1.2.7",
"version": "1.2.8",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
126 changes: 71 additions & 55 deletions src/PierTwoStakingApiBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,72 @@ export interface CreateStakeDto {
region?: "US" | "AU";
}

export interface ValidatorDeposit {
amount: number;
slot: number;
status: "QUEUED" | "PROCESSED";
}

export interface ValidatorWithdrawal {
amount: number;
withdrawableEpoch: number;
status: "QUEUED" | "PROCESSED";
}

export interface ValidatorConsolidation {
amount: number;
targetPubkey: string;
sourcePubkey: string;
status: "QUEUED" | "PROCESSED";
}

export interface Validator {
pubkey: string;
withdrawal_credentials: string;
amount: number;
signature: string;
deposit_message_root: string;
region?: "US" | "AU";
deposit_data_root: string;
fork_version: string;
network_name: string;
deposit_cli_version: string;
status: string;
suggestedFeeRecipient: string;
validatorIndex: number;
statusLastChecked: string;
balanceGwei: string;
effectiveBalanceGwei: string;
/** Stake Object ID from database */
stakeOid?: string;
/** Stake ID */
stakeId?: number;
/** Withdrawal address for the validator */
withdrawalAddress?: string;
deposits?: ValidatorDeposit[];
withdrawals?: ValidatorWithdrawal[];
consolidations?: ValidatorConsolidation[];
}

export interface StakeDetailsWithValidators {
stakeId: number;
customerId: number;
/** @format date-time */
createdAt?: string;
reference: string;
region?: "US" | "AU";
label: string;
withdrawalAddress: string;
suggestedFeeRecipient: string;
validatorStartIndex: number;
validatorCount: number;
status: string;
message: string;
/** Stake history entries */
history?: object[];
validators: Validator[];
}

export interface SimulationLog {
/**
* Event name (if decoded)
Expand Down Expand Up @@ -545,52 +611,6 @@ export interface TransactionAnalysis {
observations: TransactionAnalysisObservation[];
}

export interface Validator {
pubkey: string;
withdrawal_credentials: string;
amount: number;
signature: string;
deposit_message_root: string;
region?: "US" | "AU";
deposit_data_root: string;
fork_version: string;
network_name: string;
deposit_cli_version: string;
status: string;
suggestedFeeRecipient: string;
validatorIndex: number;
statusLastChecked: string;
balanceGwei: string;
effectiveBalanceGwei: string;
/** Stake Object ID from database */
stakeOid?: string;
/** Stake ID */
stakeId?: number;
/** Withdrawal address for the validator */
withdrawalAddress?: string;
/** Transaction analysis data */
analysis?: TransactionAnalysis;
}

export interface StakeDetailsWithValidators {
stakeId: number;
customerId: number;
/** @format date-time */
createdAt?: string;
reference: string;
region?: "US" | "AU";
label: string;
withdrawalAddress: string;
suggestedFeeRecipient: string;
validatorStartIndex: number;
validatorCount: number;
status: string;
message: string;
/** Stake history entries */
history?: object[];
validators: Validator[];
}

export interface EthereumTransactionCraftingWithAnalysisResponse {
/**
* target contract address
Expand Down Expand Up @@ -754,8 +774,9 @@ export interface ValidatorWithStakeDetails {
stakeId?: number;
/** Withdrawal address for the validator */
withdrawalAddress?: string;
/** Transaction analysis data */
analysis?: TransactionAnalysis;
deposits?: ValidatorDeposit[];
withdrawals?: ValidatorWithdrawal[];
consolidations?: ValidatorConsolidation[];
reference: string;
label: string;
}
Expand Down Expand Up @@ -795,7 +816,7 @@ export interface EstimatedWithdrawalTimes {
validation: string;
expectedExitEpoch: number;
expectedFullWithdrawalEligibilityEpoch: number;
predictedUpcomingWithdrawalEpoch: number;
predictedWithdrawalEpoch: number;
predictedExitSubmissionDeadlineEpoch: number;
}

Expand All @@ -804,11 +825,6 @@ export interface EstimateWithdrawalTimesDto {
validatorIndexes: number[];
}

export interface ValidatorDeposit {
pubkey: string;
amountGwei: string;
}

export interface GenerateDepositDataDto {
/** @example [{"pubkey":"a20d2ba70419cb3922985488e339736ab32e6184f11708d2333f65b14f70cf47365b538c32eff237cdaf293ea2bcfb03","amountGwei":"1000000000"}] */
deposits: ValidatorDeposit[];
Expand Down Expand Up @@ -2896,7 +2912,7 @@ export class HttpClient<SecurityDataType = unknown> {

/**
* @title Pier Two Staking API
* @version 1.0.116-main-mainnet
* @version 1.0.118-main-mainnet
* @baseUrl https://gw-1.api.piertwo.io
* @contact
*
Expand Down