diff --git a/src/solana/stakeAccount.ts b/src/solana/stakeAccount.ts deleted file mode 100644 index 1fa53f1..0000000 --- a/src/solana/stakeAccount.ts +++ /dev/null @@ -1,92 +0,0 @@ -// // Copied from https://github.com/igneous-labs/solana-stake-sdk -// import { AccountInfo, ParsedAccountData } from '@solana/web3.js'; -// import { StakeAccount as Account } from './types/stakeAccount'; -// import { StakeState } from './constants'; -// import { create } from 'superstruct'; -// import BigNumber from 'bignumber.js'; -// import { -// StakeStateAccount, -// } from './temp'; -// export class ParseStakeAccountError extends Error {} - -// /** -// * The `StakeAccount` provides methods for interacting with the parsed Solana stake account. -// * -// * @property account - Parser account infop AccountInfo. -// * @throws ParseStakeAccountError if `account` is AccountInfo or if unable to parse account data -// */ -// export class StakeAccount { -// public account: StakeStateAccount; -// constructor({ -// executable, -// owner, -// lamports, -// data, -// rentEpoch, -// }: StakeStateAccount) { -// // if (!('parsed' in data)) { -// throw new ParseStakeAccountError( -// 'Raw AccountInfo, data not parsed', -// ); -// } -// try { -// const parsedData = create(data.parsed, Account); -// this.account = { -// executable, -// owner, -// lamports, -// data: parsedData, -// rentEpoch, -// }; -// } catch (e) { -// throw new ParseStakeAccountError((e as Error).message); -// } -// } -// /** -// * Check if lockup is in force -// * @param currEpoch current epoch. -// * @param currUnixTimestamp current unix timetamp. -// * @returns a bool type result. -// */ -// public isLockupInForce( -// currEpoch: number, -// currUnixTimestamp: number, -// ): boolean { -// return ( -// this.account.data.info.meta.lockup.unixTimestamp > currUnixTimestamp || -// this.account.data.info.meta.lockup.epoch > currEpoch -// ); -// } -// /** -// * Determins the current state of a stake account given the current epoch -// * @param currentEpoch -// * @returns `stakeAccount`'s stake state`string` -// */ -// public stakeAccountState(currentEpoch: number): string { -// const { -// type, -// info: { stake }, -// } = this.account.data; -// if (type !== 'delegated' || stake === null) { -// return StakeState.Inactive; -// } -// const currentEpochBN = new BigNumber(currentEpoch); -// const activationEpoch = new BigNumber(stake.delegation.activationEpoch); -// const deactivationEpoch = new BigNumber(stake.delegation.deactivationEpoch); -// if (activationEpoch.gt(currentEpochBN)) { -// return StakeState.Inactive; -// } -// if (activationEpoch.eq(currentEpochBN)) { -// // if you activate then deactivate in the same epoch, -// // deactivationEpoch === activationEpoch. -// // if you deactivate then activate again in the same epoch, -// // the deactivationEpoch will be reset to EPOCH_MAX -// if (deactivationEpoch.eq(activationEpoch)) return StakeState.Inactive; -// return StakeState.Activating; -// } -// // activationEpoch < currentEpochBN -// if (deactivationEpoch.gt(currentEpochBN)) return StakeState.Active; -// if (deactivationEpoch.eq(currentEpochBN)) return StakeState.Deactivating; -// return StakeState.Deactivated; -// } -// } diff --git a/src/solana/types/index.ts b/src/solana/types/index.ts index a3942e3..c23a18a 100644 --- a/src/solana/types/index.ts +++ b/src/solana/types/index.ts @@ -1,9 +1,4 @@ import { - // Account, - // AccountInfo, - // ParsedAccountData, - // PublicKey, - // VersionedTransaction, Address, TransactionMessageWithBlockhashLifetime, } from '@solana/web3.js'; @@ -22,14 +17,4 @@ export type StakeResponse = CreateAccountResponse; export type ClaimResponse = { claimVerTx: TransactionMessageWithBlockhashLifetime; totalClaimAmount: bigint; -}; - -// export type Account = { -// pubkey: PublicKey; -// account: StakeAccount; -// }; - -// export type AccountToSplit = { -// account: Account; -// lamports: number; -// }; +}; \ No newline at end of file