@@ -3,6 +3,7 @@ import { DecodedCloseAccountInstruction } from '@solana/spl-token';
33import { Blockhash , StakeInstructionType , SystemInstructionType , TransactionSignature } from '@solana/web3.js' ;
44import { InstructionBuilderTypes } from './constants' ;
55import { StakePoolInstructionType } from '@solana/spl-stake-pool' ;
6+ import { DepositSolStakePoolData , WithdrawStakeStakePoolData } from './jitoStakePoolOperations' ;
67
78// TODO(STLX-9890): Add the interfaces for validityWindow and SequenceId
89export interface SolanaKeys {
@@ -41,6 +42,7 @@ export type InstructionParams =
4142 | StakingDelegate
4243 | MintTo
4344 | Burn
45+ | Approve
4446 | CustomInstruction ;
4547
4648export interface Memo {
@@ -107,15 +109,38 @@ export interface Burn {
107109 } ;
108110}
109111
112+ export interface Approve {
113+ type : InstructionBuilderTypes . Approve ;
114+ params : {
115+ accountAddress : string ;
116+ delegateAddress : string ;
117+ ownerAddress : string ;
118+ amount : string ;
119+ programId ?: string ;
120+ } ;
121+ }
122+
123+ export enum StakingType {
124+ NATIVE = 'NATIVE' ,
125+ MARINADE = 'MARINADE' ,
126+ JITO = 'JITO' ,
127+ }
128+
129+ export interface JitoStakingActivateParams {
130+ stakePoolData : DepositSolStakePoolData ;
131+ }
132+
133+ export type StakingActivateExtraParams = JitoStakingActivateParams ;
134+
110135export interface StakingActivate {
111136 type : InstructionBuilderTypes . StakingActivate ;
112137 params : {
113138 fromAddress : string ;
114139 stakingAddress : string ;
115140 amount : string ;
116141 validator : string ;
117- isMarinade ?: boolean ;
118- isJito ?: boolean ;
142+ stakingType : StakingType ;
143+ extraParams ?: StakingActivateExtraParams ;
119144 } ;
120145}
121146
@@ -124,14 +149,23 @@ export interface StakingDelegate {
124149 params : { stakingAddress : string ; fromAddress : string ; validator : string } ;
125150}
126151
152+ export interface JitoStakingDeactivateParams {
153+ stakePoolData : WithdrawStakeStakePoolData ;
154+ validatorAddress : string ;
155+ transferAuthorityAddress : string ;
156+ }
157+
158+ export type StakingDeactivateExtraParams = JitoStakingDeactivateParams ;
159+
127160export interface StakingDeactivate {
128161 type : InstructionBuilderTypes . StakingDeactivate ;
129162 params : {
130163 fromAddress : string ;
131164 stakingAddress : string ;
132165 amount ?: string ;
133166 unstakingAddress ?: string ;
134- isMarinade ?: boolean ;
167+ stakingType : StakingType ;
168+ extraParams ?: StakingDeactivateExtraParams ;
135169 recipients ?: Recipient [ ] ;
136170 } ;
137171}
@@ -187,7 +221,8 @@ export type ValidInstructionTypes =
187221 | 'TokenTransfer'
188222 | 'SetPriorityFee'
189223 | 'MintTo'
190- | 'Burn' ;
224+ | 'Burn'
225+ | 'Approve' ;
191226
192227export type StakingAuthorizeParams = {
193228 stakingAddress : string ;
0 commit comments