@streamflow/staking 9.0.4 → 10.0.0-alpha.p313.18b7be3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/index.cjs +27 -28
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +30 -31
- package/dist/esm/index.d.ts +30 -31
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { IdlAccounts, Address, Program, ProgramAccount, Idl, AccountsCoder } from '@coral-xyz/anchor';
|
|
2
2
|
import { PublicKey, Keypair, Connection, Commitment, ConnectionConfig, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
-
import { ICluster, ITransactionResult } from '@streamflow/common';
|
|
3
|
+
import { ICluster, ITransactionExt, ITransactionResult } from '@streamflow/common';
|
|
4
4
|
import PQueue from 'p-queue';
|
|
5
5
|
import BN from 'bn.js';
|
|
6
6
|
import { FeeManager } from './solana/descriptor/fee_manager.cjs';
|
|
7
7
|
import { RewardPool as RewardPool$1 } from './solana/descriptor/reward_pool.cjs';
|
|
8
8
|
import { StakePool as StakePool$1 } from './solana/descriptor/stake_pool.cjs';
|
|
9
9
|
import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
10
|
-
import { ITransactionSolanaExt } from '@streamflow/common/solana';
|
|
11
10
|
import { TransferFeeConfig } from '@solana/spl-token';
|
|
12
11
|
|
|
13
12
|
declare const FEE_PRECISION_FACTOR = 10000;
|
|
@@ -2821,7 +2820,7 @@ type RewardEntry = IdlAccounts<RewardPool$1>["rewardEntry"];
|
|
|
2821
2820
|
type RewardPool = IdlAccounts<RewardPool$1>["rewardPool"];
|
|
2822
2821
|
type FeeValue = IdlAccounts<FeeManager>["feeValue"];
|
|
2823
2822
|
type DefaultFeeValueConfig = IdlAccounts<FeeManager>["config"];
|
|
2824
|
-
interface
|
|
2823
|
+
interface IInteractExt extends ITransactionExt {
|
|
2825
2824
|
invoker: SignerWalletAdapter | Keypair;
|
|
2826
2825
|
}
|
|
2827
2826
|
interface BaseStakePoolArgs {
|
|
@@ -2950,12 +2949,12 @@ declare class SolanaStakingClient {
|
|
|
2950
2949
|
getFee(target: string | PublicKey): Promise<FeeValue | DefaultFeeValueConfig>;
|
|
2951
2950
|
getDefaultFeeValue(): Promise<DefaultFeeValueConfig>;
|
|
2952
2951
|
getFeeValueIfExists(target: string | PublicKey): Promise<FeeValue | null>;
|
|
2953
|
-
createStakePool(data: CreateStakePoolArgs, extParams:
|
|
2954
|
-
prepareCreateStakePoolInstructions({ maxWeight, maxDuration, minDuration, mint, permissionless, freezeStakeMint, unstakePeriod, maxTotalStakeCumulative, expiryTs, autoUnstake, nonce, tokenProgramId, }: CreateStakePoolArgs, extParams:
|
|
2952
|
+
createStakePool(data: CreateStakePoolArgs, extParams: IInteractExt): Promise<CreationResult>;
|
|
2953
|
+
prepareCreateStakePoolInstructions({ maxWeight, maxDuration, minDuration, mint, permissionless, freezeStakeMint, unstakePeriod, maxTotalStakeCumulative, expiryTs, autoUnstake, nonce, tokenProgramId, }: CreateStakePoolArgs, extParams: IInteractExt): Promise<{
|
|
2955
2954
|
ixs: TransactionInstruction[];
|
|
2956
2955
|
publicKey: PublicKey;
|
|
2957
2956
|
}>;
|
|
2958
|
-
stake(data: StakeArgs, extParams:
|
|
2957
|
+
stake(data: StakeArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2959
2958
|
/**
|
|
2960
2959
|
* Stake into a Pool and creates Reward Entries to track rewards.
|
|
2961
2960
|
*
|
|
@@ -2964,14 +2963,14 @@ declare class SolanaStakingClient {
|
|
|
2964
2963
|
* @param data - enriched stake params with an array of reward pools
|
|
2965
2964
|
* @param extParams - parameter required for transaction execution
|
|
2966
2965
|
*/
|
|
2967
|
-
stakeAndCreateEntries(data: StakeAndCreateEntriesArgs, extParams:
|
|
2968
|
-
prepareStakeAndCreateEntriesInstructions(data: StakeAndCreateEntriesArgs, extParams:
|
|
2966
|
+
stakeAndCreateEntries(data: StakeAndCreateEntriesArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2967
|
+
prepareStakeAndCreateEntriesInstructions(data: StakeAndCreateEntriesArgs, extParams: IInteractExt): Promise<{
|
|
2969
2968
|
ixs: TransactionInstruction[];
|
|
2970
2969
|
}>;
|
|
2971
|
-
prepareStakeInstructions({ nonce, amount, duration, stakePool, stakePoolMint, tokenProgramId }: StakeArgs, extParams:
|
|
2970
|
+
prepareStakeInstructions({ nonce, amount, duration, stakePool, stakePoolMint, tokenProgramId }: StakeArgs, extParams: IInteractExt): Promise<{
|
|
2972
2971
|
ixs: TransactionInstruction[];
|
|
2973
2972
|
}>;
|
|
2974
|
-
unstake(data: UnstakeArgs, extParams:
|
|
2973
|
+
unstake(data: UnstakeArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2975
2974
|
/**
|
|
2976
2975
|
* Unstake from a pool, claiming all rewards prior to that.
|
|
2977
2976
|
*
|
|
@@ -2980,8 +2979,8 @@ declare class SolanaStakingClient {
|
|
|
2980
2979
|
* @param data - enriched unstake args with reward pools
|
|
2981
2980
|
* @param extParams - parameter required for transaction execution
|
|
2982
2981
|
*/
|
|
2983
|
-
unstakeAndClaim(data: UnstakeAndClaimArgs, extParams:
|
|
2984
|
-
prepareUnstakeAndClaimInstructions(data: UnstakeAndClaimArgs, extParams:
|
|
2982
|
+
unstakeAndClaim(data: UnstakeAndClaimArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2983
|
+
prepareUnstakeAndClaimInstructions(data: UnstakeAndClaimArgs, extParams: IInteractExt): Promise<{
|
|
2985
2984
|
ixs: TransactionInstruction[];
|
|
2986
2985
|
}>;
|
|
2987
2986
|
/**
|
|
@@ -2994,51 +2993,51 @@ declare class SolanaStakingClient {
|
|
|
2994
2993
|
* @param data - enriched unstake args with reward pools
|
|
2995
2994
|
* @param extParams - parameter required for transaction execution
|
|
2996
2995
|
*/
|
|
2997
|
-
unstakeAndClose(data: UnstakeAndCloseArgs, extParams:
|
|
2998
|
-
prepareUnstakeAndCloseInstructions(data: UnstakeAndCloseArgs, extParams:
|
|
2996
|
+
unstakeAndClose(data: UnstakeAndCloseArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2997
|
+
prepareUnstakeAndCloseInstructions(data: UnstakeAndCloseArgs, extParams: IInteractExt): Promise<{
|
|
2999
2998
|
ixs: TransactionInstruction[];
|
|
3000
2999
|
}>;
|
|
3001
|
-
prepareUnstakeInstructions({ stakePool, stakePoolMint, nonce, tokenProgramId, shouldClose }: UnstakeArgs, extParams:
|
|
3000
|
+
prepareUnstakeInstructions({ stakePool, stakePoolMint, nonce, tokenProgramId, shouldClose }: UnstakeArgs, extParams: IInteractExt): Promise<{
|
|
3002
3001
|
ixs: TransactionInstruction[];
|
|
3003
3002
|
}>;
|
|
3004
|
-
closeStakeEntry(data: CloseStakeEntryArgs, extParams:
|
|
3003
|
+
closeStakeEntry(data: CloseStakeEntryArgs, extParams: IInteractExt): Promise<{
|
|
3005
3004
|
ixs: TransactionInstruction[];
|
|
3006
3005
|
txId: string;
|
|
3007
3006
|
}>;
|
|
3008
|
-
prepareCloseStakeEntryInstructions({ stakePool, nonce }: CloseStakeEntryArgs, extParams:
|
|
3007
|
+
prepareCloseStakeEntryInstructions({ stakePool, nonce }: CloseStakeEntryArgs, extParams: IInteractExt): Promise<{
|
|
3009
3008
|
ixs: TransactionInstruction[];
|
|
3010
3009
|
}>;
|
|
3011
|
-
createRewardPool(data: CreateRewardPoolArgs, extParams:
|
|
3012
|
-
prepareCreateRewardPoolInstructions({ nonce, rewardAmount, rewardPeriod, rewardMint, permissionless, stakePool, lastClaimPeriodOpt, tokenProgramId, }: CreateRewardPoolArgs, extParams:
|
|
3010
|
+
createRewardPool(data: CreateRewardPoolArgs, extParams: IInteractExt): Promise<CreationResult>;
|
|
3011
|
+
prepareCreateRewardPoolInstructions({ nonce, rewardAmount, rewardPeriod, rewardMint, permissionless, stakePool, lastClaimPeriodOpt, tokenProgramId, }: CreateRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3013
3012
|
publicKey: PublicKey;
|
|
3014
3013
|
ixs: TransactionInstruction[];
|
|
3015
3014
|
}>;
|
|
3016
|
-
claimRewards(data: ClaimRewardPoolArgs, extParams:
|
|
3017
|
-
prepareClaimRewardsInstructions({ rewardPoolNonce, depositNonce, stakePool, tokenProgramId, rewardMint, rewardPoolType, governor, vote, }: ClaimRewardPoolArgs, extParams:
|
|
3015
|
+
claimRewards(data: ClaimRewardPoolArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3016
|
+
prepareClaimRewardsInstructions({ rewardPoolNonce, depositNonce, stakePool, tokenProgramId, rewardMint, rewardPoolType, governor, vote, }: ClaimRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3018
3017
|
ixs: TransactionInstruction[];
|
|
3019
3018
|
}>;
|
|
3020
|
-
fundPool(data: FundPoolArgs, extParams:
|
|
3021
|
-
prepareFundPoolInstructions({ amount, tokenProgramId, rewardMint, stakePool, feeValue, nonce, rewardPoolType, }: FundPoolArgs, extParams:
|
|
3019
|
+
fundPool(data: FundPoolArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3020
|
+
prepareFundPoolInstructions({ amount, tokenProgramId, rewardMint, stakePool, feeValue, nonce, rewardPoolType, }: FundPoolArgs, extParams: IInteractExt): Promise<{
|
|
3022
3021
|
ixs: TransactionInstruction[];
|
|
3023
3022
|
}>;
|
|
3024
|
-
createRewardEntry(data: CreateRewardEntryArgs, extParams:
|
|
3025
|
-
prepareCreateRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams:
|
|
3023
|
+
createRewardEntry(data: CreateRewardEntryArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3024
|
+
prepareCreateRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams: IInteractExt): Promise<{
|
|
3026
3025
|
ixs: TransactionInstruction[];
|
|
3027
3026
|
}>;
|
|
3028
|
-
closeRewardEntry(data: CloseRewardEntryArgs, extParams:
|
|
3029
|
-
prepareCloseRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams:
|
|
3027
|
+
closeRewardEntry(data: CloseRewardEntryArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3028
|
+
prepareCloseRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams: IInteractExt): Promise<{
|
|
3030
3029
|
ixs: TransactionInstruction[];
|
|
3031
3030
|
}>;
|
|
3032
|
-
updateRewardPool(data: UpdateRewardPoolArgs, extParams:
|
|
3031
|
+
updateRewardPool(data: UpdateRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3033
3032
|
ixs: TransactionInstruction[];
|
|
3034
3033
|
txId: string;
|
|
3035
3034
|
}>;
|
|
3036
|
-
prepareUpdateRewardPoolInstructions({ rewardPool, rewardAmount, rewardPeriod, stakePool }: UpdateRewardPoolArgs, extParams:
|
|
3035
|
+
prepareUpdateRewardPoolInstructions({ rewardPool, rewardAmount, rewardPeriod, stakePool }: UpdateRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3037
3036
|
ixs: TransactionInstruction[];
|
|
3038
3037
|
}>;
|
|
3039
3038
|
decode<ProgramName extends keyof Programs = keyof Programs, DecodingProgram = Programs[ProgramName], DerivedIdl extends Idl = DecodingProgram extends Program<infer IDLType> ? IDLType : never, AccountName extends keyof IdlAccounts<DerivedIdl> = keyof IdlAccounts<DerivedIdl>, DecodedAccount = IdlAccounts<DerivedIdl>[AccountName]>(programKey: ProgramName, accountName: AccountName, accInfo: Parameters<AccountsCoder["decode"]>[1]): DecodedAccount;
|
|
3040
3039
|
getDiscriminator<ProgramName extends keyof Programs = keyof Programs, DecodingProgram = Programs[ProgramName], DerivedIdl extends Idl = DecodingProgram extends Program<infer IDLType> ? IDLType : never, AccountName extends keyof IdlAccounts<DerivedIdl> = keyof IdlAccounts<DerivedIdl>>(programKey: ProgramName, accountName: AccountName): number[];
|
|
3041
|
-
execute(ixs: TransactionInstruction[], extParams:
|
|
3040
|
+
execute(ixs: TransactionInstruction[], extParams: IInteractExt): Promise<{
|
|
3042
3041
|
signature: string;
|
|
3043
3042
|
}>;
|
|
3044
3043
|
private getRewardProgram;
|
|
@@ -3088,4 +3087,4 @@ declare function calculateAmountWithTransferFees(connection: Connection, transfe
|
|
|
3088
3087
|
|
|
3089
3088
|
declare const calculateStakeWeight: (minDuration: BN, maxDuration: BN, maxWeight: BN, duration: BN) => BN;
|
|
3090
3089
|
|
|
3091
|
-
export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CloseRewardEntryArgs, type CloseStakeEntryArgs, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type
|
|
3090
|
+
export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CloseRewardEntryArgs, type CloseStakeEntryArgs, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type IInteractExt, type RewardEntry, RewardEntryAccumulator, type RewardPool, SolanaStakingClient, type StakeAndCreateEntriesArgs, type StakeArgs, type StakeEntry, type StakePool, type UnstakeAndClaimArgs, type UnstakeAndCloseArgs, type UnstakeArgs, type UpdateRewardPoolArgs, calcRewards, calculateAmountWithTransferFees, calculateDecimalsShift, calculateFeeAmount, calculateRewardAmountFromRate, calculateRewardAmountFromValue, calculateRewardRateFromAmount, calculateStakeWeight, constants, deriveConfigPDA, deriveFeeValuePDA, deriveRewardEntryPDA, deriveRewardPoolPDA, deriveRewardVaultPDA, deriveStakeEntryPDA, deriveStakeMintPDA, deriveStakePoolPDA, deriveStakeVaultPDA };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { IdlAccounts, Address, Program, ProgramAccount, Idl, AccountsCoder } from '@coral-xyz/anchor';
|
|
2
2
|
import { PublicKey, Keypair, Connection, Commitment, ConnectionConfig, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
-
import { ICluster, ITransactionResult } from '@streamflow/common';
|
|
3
|
+
import { ICluster, ITransactionExt, ITransactionResult } from '@streamflow/common';
|
|
4
4
|
import PQueue from 'p-queue';
|
|
5
5
|
import BN from 'bn.js';
|
|
6
6
|
import { FeeManager } from './solana/descriptor/fee_manager.js';
|
|
7
7
|
import { RewardPool as RewardPool$1 } from './solana/descriptor/reward_pool.js';
|
|
8
8
|
import { StakePool as StakePool$1 } from './solana/descriptor/stake_pool.js';
|
|
9
9
|
import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
10
|
-
import { ITransactionSolanaExt } from '@streamflow/common/solana';
|
|
11
10
|
import { TransferFeeConfig } from '@solana/spl-token';
|
|
12
11
|
|
|
13
12
|
declare const FEE_PRECISION_FACTOR = 10000;
|
|
@@ -2821,7 +2820,7 @@ type RewardEntry = IdlAccounts<RewardPool$1>["rewardEntry"];
|
|
|
2821
2820
|
type RewardPool = IdlAccounts<RewardPool$1>["rewardPool"];
|
|
2822
2821
|
type FeeValue = IdlAccounts<FeeManager>["feeValue"];
|
|
2823
2822
|
type DefaultFeeValueConfig = IdlAccounts<FeeManager>["config"];
|
|
2824
|
-
interface
|
|
2823
|
+
interface IInteractExt extends ITransactionExt {
|
|
2825
2824
|
invoker: SignerWalletAdapter | Keypair;
|
|
2826
2825
|
}
|
|
2827
2826
|
interface BaseStakePoolArgs {
|
|
@@ -2950,12 +2949,12 @@ declare class SolanaStakingClient {
|
|
|
2950
2949
|
getFee(target: string | PublicKey): Promise<FeeValue | DefaultFeeValueConfig>;
|
|
2951
2950
|
getDefaultFeeValue(): Promise<DefaultFeeValueConfig>;
|
|
2952
2951
|
getFeeValueIfExists(target: string | PublicKey): Promise<FeeValue | null>;
|
|
2953
|
-
createStakePool(data: CreateStakePoolArgs, extParams:
|
|
2954
|
-
prepareCreateStakePoolInstructions({ maxWeight, maxDuration, minDuration, mint, permissionless, freezeStakeMint, unstakePeriod, maxTotalStakeCumulative, expiryTs, autoUnstake, nonce, tokenProgramId, }: CreateStakePoolArgs, extParams:
|
|
2952
|
+
createStakePool(data: CreateStakePoolArgs, extParams: IInteractExt): Promise<CreationResult>;
|
|
2953
|
+
prepareCreateStakePoolInstructions({ maxWeight, maxDuration, minDuration, mint, permissionless, freezeStakeMint, unstakePeriod, maxTotalStakeCumulative, expiryTs, autoUnstake, nonce, tokenProgramId, }: CreateStakePoolArgs, extParams: IInteractExt): Promise<{
|
|
2955
2954
|
ixs: TransactionInstruction[];
|
|
2956
2955
|
publicKey: PublicKey;
|
|
2957
2956
|
}>;
|
|
2958
|
-
stake(data: StakeArgs, extParams:
|
|
2957
|
+
stake(data: StakeArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2959
2958
|
/**
|
|
2960
2959
|
* Stake into a Pool and creates Reward Entries to track rewards.
|
|
2961
2960
|
*
|
|
@@ -2964,14 +2963,14 @@ declare class SolanaStakingClient {
|
|
|
2964
2963
|
* @param data - enriched stake params with an array of reward pools
|
|
2965
2964
|
* @param extParams - parameter required for transaction execution
|
|
2966
2965
|
*/
|
|
2967
|
-
stakeAndCreateEntries(data: StakeAndCreateEntriesArgs, extParams:
|
|
2968
|
-
prepareStakeAndCreateEntriesInstructions(data: StakeAndCreateEntriesArgs, extParams:
|
|
2966
|
+
stakeAndCreateEntries(data: StakeAndCreateEntriesArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2967
|
+
prepareStakeAndCreateEntriesInstructions(data: StakeAndCreateEntriesArgs, extParams: IInteractExt): Promise<{
|
|
2969
2968
|
ixs: TransactionInstruction[];
|
|
2970
2969
|
}>;
|
|
2971
|
-
prepareStakeInstructions({ nonce, amount, duration, stakePool, stakePoolMint, tokenProgramId }: StakeArgs, extParams:
|
|
2970
|
+
prepareStakeInstructions({ nonce, amount, duration, stakePool, stakePoolMint, tokenProgramId }: StakeArgs, extParams: IInteractExt): Promise<{
|
|
2972
2971
|
ixs: TransactionInstruction[];
|
|
2973
2972
|
}>;
|
|
2974
|
-
unstake(data: UnstakeArgs, extParams:
|
|
2973
|
+
unstake(data: UnstakeArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2975
2974
|
/**
|
|
2976
2975
|
* Unstake from a pool, claiming all rewards prior to that.
|
|
2977
2976
|
*
|
|
@@ -2980,8 +2979,8 @@ declare class SolanaStakingClient {
|
|
|
2980
2979
|
* @param data - enriched unstake args with reward pools
|
|
2981
2980
|
* @param extParams - parameter required for transaction execution
|
|
2982
2981
|
*/
|
|
2983
|
-
unstakeAndClaim(data: UnstakeAndClaimArgs, extParams:
|
|
2984
|
-
prepareUnstakeAndClaimInstructions(data: UnstakeAndClaimArgs, extParams:
|
|
2982
|
+
unstakeAndClaim(data: UnstakeAndClaimArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2983
|
+
prepareUnstakeAndClaimInstructions(data: UnstakeAndClaimArgs, extParams: IInteractExt): Promise<{
|
|
2985
2984
|
ixs: TransactionInstruction[];
|
|
2986
2985
|
}>;
|
|
2987
2986
|
/**
|
|
@@ -2994,51 +2993,51 @@ declare class SolanaStakingClient {
|
|
|
2994
2993
|
* @param data - enriched unstake args with reward pools
|
|
2995
2994
|
* @param extParams - parameter required for transaction execution
|
|
2996
2995
|
*/
|
|
2997
|
-
unstakeAndClose(data: UnstakeAndCloseArgs, extParams:
|
|
2998
|
-
prepareUnstakeAndCloseInstructions(data: UnstakeAndCloseArgs, extParams:
|
|
2996
|
+
unstakeAndClose(data: UnstakeAndCloseArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
2997
|
+
prepareUnstakeAndCloseInstructions(data: UnstakeAndCloseArgs, extParams: IInteractExt): Promise<{
|
|
2999
2998
|
ixs: TransactionInstruction[];
|
|
3000
2999
|
}>;
|
|
3001
|
-
prepareUnstakeInstructions({ stakePool, stakePoolMint, nonce, tokenProgramId, shouldClose }: UnstakeArgs, extParams:
|
|
3000
|
+
prepareUnstakeInstructions({ stakePool, stakePoolMint, nonce, tokenProgramId, shouldClose }: UnstakeArgs, extParams: IInteractExt): Promise<{
|
|
3002
3001
|
ixs: TransactionInstruction[];
|
|
3003
3002
|
}>;
|
|
3004
|
-
closeStakeEntry(data: CloseStakeEntryArgs, extParams:
|
|
3003
|
+
closeStakeEntry(data: CloseStakeEntryArgs, extParams: IInteractExt): Promise<{
|
|
3005
3004
|
ixs: TransactionInstruction[];
|
|
3006
3005
|
txId: string;
|
|
3007
3006
|
}>;
|
|
3008
|
-
prepareCloseStakeEntryInstructions({ stakePool, nonce }: CloseStakeEntryArgs, extParams:
|
|
3007
|
+
prepareCloseStakeEntryInstructions({ stakePool, nonce }: CloseStakeEntryArgs, extParams: IInteractExt): Promise<{
|
|
3009
3008
|
ixs: TransactionInstruction[];
|
|
3010
3009
|
}>;
|
|
3011
|
-
createRewardPool(data: CreateRewardPoolArgs, extParams:
|
|
3012
|
-
prepareCreateRewardPoolInstructions({ nonce, rewardAmount, rewardPeriod, rewardMint, permissionless, stakePool, lastClaimPeriodOpt, tokenProgramId, }: CreateRewardPoolArgs, extParams:
|
|
3010
|
+
createRewardPool(data: CreateRewardPoolArgs, extParams: IInteractExt): Promise<CreationResult>;
|
|
3011
|
+
prepareCreateRewardPoolInstructions({ nonce, rewardAmount, rewardPeriod, rewardMint, permissionless, stakePool, lastClaimPeriodOpt, tokenProgramId, }: CreateRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3013
3012
|
publicKey: PublicKey;
|
|
3014
3013
|
ixs: TransactionInstruction[];
|
|
3015
3014
|
}>;
|
|
3016
|
-
claimRewards(data: ClaimRewardPoolArgs, extParams:
|
|
3017
|
-
prepareClaimRewardsInstructions({ rewardPoolNonce, depositNonce, stakePool, tokenProgramId, rewardMint, rewardPoolType, governor, vote, }: ClaimRewardPoolArgs, extParams:
|
|
3015
|
+
claimRewards(data: ClaimRewardPoolArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3016
|
+
prepareClaimRewardsInstructions({ rewardPoolNonce, depositNonce, stakePool, tokenProgramId, rewardMint, rewardPoolType, governor, vote, }: ClaimRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3018
3017
|
ixs: TransactionInstruction[];
|
|
3019
3018
|
}>;
|
|
3020
|
-
fundPool(data: FundPoolArgs, extParams:
|
|
3021
|
-
prepareFundPoolInstructions({ amount, tokenProgramId, rewardMint, stakePool, feeValue, nonce, rewardPoolType, }: FundPoolArgs, extParams:
|
|
3019
|
+
fundPool(data: FundPoolArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3020
|
+
prepareFundPoolInstructions({ amount, tokenProgramId, rewardMint, stakePool, feeValue, nonce, rewardPoolType, }: FundPoolArgs, extParams: IInteractExt): Promise<{
|
|
3022
3021
|
ixs: TransactionInstruction[];
|
|
3023
3022
|
}>;
|
|
3024
|
-
createRewardEntry(data: CreateRewardEntryArgs, extParams:
|
|
3025
|
-
prepareCreateRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams:
|
|
3023
|
+
createRewardEntry(data: CreateRewardEntryArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3024
|
+
prepareCreateRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams: IInteractExt): Promise<{
|
|
3026
3025
|
ixs: TransactionInstruction[];
|
|
3027
3026
|
}>;
|
|
3028
|
-
closeRewardEntry(data: CloseRewardEntryArgs, extParams:
|
|
3029
|
-
prepareCloseRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams:
|
|
3027
|
+
closeRewardEntry(data: CloseRewardEntryArgs, extParams: IInteractExt): Promise<ITransactionResult>;
|
|
3028
|
+
prepareCloseRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams: IInteractExt): Promise<{
|
|
3030
3029
|
ixs: TransactionInstruction[];
|
|
3031
3030
|
}>;
|
|
3032
|
-
updateRewardPool(data: UpdateRewardPoolArgs, extParams:
|
|
3031
|
+
updateRewardPool(data: UpdateRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3033
3032
|
ixs: TransactionInstruction[];
|
|
3034
3033
|
txId: string;
|
|
3035
3034
|
}>;
|
|
3036
|
-
prepareUpdateRewardPoolInstructions({ rewardPool, rewardAmount, rewardPeriod, stakePool }: UpdateRewardPoolArgs, extParams:
|
|
3035
|
+
prepareUpdateRewardPoolInstructions({ rewardPool, rewardAmount, rewardPeriod, stakePool }: UpdateRewardPoolArgs, extParams: IInteractExt): Promise<{
|
|
3037
3036
|
ixs: TransactionInstruction[];
|
|
3038
3037
|
}>;
|
|
3039
3038
|
decode<ProgramName extends keyof Programs = keyof Programs, DecodingProgram = Programs[ProgramName], DerivedIdl extends Idl = DecodingProgram extends Program<infer IDLType> ? IDLType : never, AccountName extends keyof IdlAccounts<DerivedIdl> = keyof IdlAccounts<DerivedIdl>, DecodedAccount = IdlAccounts<DerivedIdl>[AccountName]>(programKey: ProgramName, accountName: AccountName, accInfo: Parameters<AccountsCoder["decode"]>[1]): DecodedAccount;
|
|
3040
3039
|
getDiscriminator<ProgramName extends keyof Programs = keyof Programs, DecodingProgram = Programs[ProgramName], DerivedIdl extends Idl = DecodingProgram extends Program<infer IDLType> ? IDLType : never, AccountName extends keyof IdlAccounts<DerivedIdl> = keyof IdlAccounts<DerivedIdl>>(programKey: ProgramName, accountName: AccountName): number[];
|
|
3041
|
-
execute(ixs: TransactionInstruction[], extParams:
|
|
3040
|
+
execute(ixs: TransactionInstruction[], extParams: IInteractExt): Promise<{
|
|
3042
3041
|
signature: string;
|
|
3043
3042
|
}>;
|
|
3044
3043
|
private getRewardProgram;
|
|
@@ -3088,4 +3087,4 @@ declare function calculateAmountWithTransferFees(connection: Connection, transfe
|
|
|
3088
3087
|
|
|
3089
3088
|
declare const calculateStakeWeight: (minDuration: BN, maxDuration: BN, maxWeight: BN, duration: BN) => BN;
|
|
3090
3089
|
|
|
3091
|
-
export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CloseRewardEntryArgs, type CloseStakeEntryArgs, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type
|
|
3090
|
+
export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CloseRewardEntryArgs, type CloseStakeEntryArgs, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type IInteractExt, type RewardEntry, RewardEntryAccumulator, type RewardPool, SolanaStakingClient, type StakeAndCreateEntriesArgs, type StakeArgs, type StakeEntry, type StakePool, type UnstakeAndClaimArgs, type UnstakeAndCloseArgs, type UnstakeArgs, type UpdateRewardPoolArgs, calcRewards, calculateAmountWithTransferFees, calculateDecimalsShift, calculateFeeAmount, calculateRewardAmountFromRate, calculateRewardAmountFromValue, calculateRewardRateFromAmount, calculateStakeWeight, constants, deriveConfigPDA, deriveFeeValuePDA, deriveRewardEntryPDA, deriveRewardPoolPDA, deriveRewardVaultPDA, deriveStakeEntryPDA, deriveStakeMintPDA, deriveStakePoolPDA, deriveStakeVaultPDA };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Program, translateError, parseIdlErrors } from '@coral-xyz/anchor';
|
|
2
2
|
import { TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync } from '@solana/spl-token';
|
|
3
3
|
import { PublicKey, Connection } from '@solana/web3.js';
|
|
4
|
-
import { ICluster, invariant, ContractError, getNumberFromBN, getBN, divCeilN } from '@streamflow/common';
|
|
5
|
-
import { buildSendThrottler, getFilters, pk, checkOrCreateAtaBatch, unwrapExecutionParams, createAndEstimateTransaction, prepareBaseInstructions, prepareTransaction, signAndExecuteTransaction } from '@streamflow/common/solana';
|
|
4
|
+
import { ICluster, buildSendThrottler, invariant, getFilters, pk, checkOrCreateAtaBatch, unwrapExecutionParams, createAndEstimateTransaction, prepareBaseInstructions, prepareTransaction, signAndExecuteTransaction, ContractError, getNumberFromBN, getBN, divCeilN } from '@streamflow/common';
|
|
6
5
|
import BN4 from 'bn.js';
|
|
7
6
|
import '@solana/wallet-adapter-base';
|
|
8
7
|
|