SolanaStakingClient
SolanaStakingClient
Defined in: staking/solana/client.ts:107
Constructors
Constructor
new SolanaStakingClient(__namedParameters): SolanaStakingClient;Defined in: staking/solana/client.ts:118
Parameters
| Parameter | Type |
|---|---|
__namedParameters | IInitOptions |
Returns
SolanaStakingClient
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
connection | public | Connection | staking/solana/client.ts:108 |
programs | readonly | Programs | staking/solana/client.ts:116 |
Methods
claimRewards()
claimRewards(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:579
Parameters
| Parameter | Type |
|---|---|
data | ClaimRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<ITransactionResult>
clawback()
clawback(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:686
Parameters
| Parameter | Type |
|---|---|
data | ClawbackRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<ITransactionResult>
closeRewardEntry()
closeRewardEntry(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:753
Parameters
| Parameter | Type |
|---|---|
data | CreateRewardEntryArgs |
extParams | IInteractExt |
Returns
Promise<ITransactionResult>
closeStakeEntry()
closeStakeEntry(data, extParams): Promise<{
ixs: TransactionInstruction[];
txId: string;
}>;Defined in: staking/solana/client.ts:512
Parameters
| Parameter | Type |
|---|---|
data | CloseStakeEntryArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
txId: string;
}>
createFundDelegate()
createFundDelegate(data, extParams): Promise<CreateFundDelegateResult>;Defined in: staking/solana/client.ts:781
Parameters
| Parameter | Type |
|---|---|
data | CreateFundDelegateArgs |
extParams | IInteractExt |
Returns
Promise<CreateFundDelegateResult>
createRewardEntry()
createRewardEntry(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:719
Parameters
| Parameter | Type |
|---|---|
data | CreateRewardEntryArgs |
extParams | IInteractExt |
Returns
Promise<ITransactionResult>
createRewardPool()
createRewardPool(data, extParams): Promise<CreationResult>;Defined in: staking/solana/client.ts:537
Parameters
| Parameter | Type |
|---|---|
data | CreateRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<CreationResult>
createStakePool()
createStakePool(data, extParams): Promise<CreationResult>;Defined in: staking/solana/client.ts:237
Parameters
| Parameter | Type |
|---|---|
data | CreateStakePoolArgs |
extParams | IInteractExt |
Returns
Promise<CreationResult>
decode()
decode<ProgramName, DecodingProgram, DerivedIdl, AccountName, DecodedAccount>(
programKey,
accountName,
accInfo): DecodedAccount;Defined in: staking/solana/client.ts:845
Type Parameters
| Type Parameter | Default type |
|---|---|
ProgramName extends keyof Programs | keyof Programs |
DecodingProgram | Programs[ProgramName] |
DerivedIdl extends Idl | DecodingProgram extends Program<IDLType> ? IDLType : never |
AccountName extends string | number | symbol | keyof IdlAccounts<DerivedIdl> |
DecodedAccount | IdlAccounts<DerivedIdl>[AccountName] |
Parameters
| Parameter | Type |
|---|---|
programKey | ProgramName |
accountName | AccountName |
accInfo | Buffer<ArrayBufferLike> |
Returns
DecodedAccount
execute()
execute(ixs, extParams): Promise<{
signature: string;
}>;Defined in: staking/solana/client.ts:877
Parameters
| Parameter | Type |
|---|---|
ixs | TransactionInstruction[] |
extParams | IInteractExt |
Returns
Promise<{
signature: string;
}>
fundPool()
fundPool(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:631
Parameters
| Parameter | Type |
|---|---|
data | FundPoolArgs |
extParams | IInteractExt |
Returns
Promise<ITransactionResult>
getCommitment()
getCommitment(): Commitment;Defined in: staking/solana/client.ts:175
Returns
Commitment
getCurrentProgramId()
getCurrentProgramId(programKey): PublicKey;Defined in: staking/solana/client.ts:169
Parameters
| Parameter | Type |
|---|---|
programKey | keyof Programs |
Returns
PublicKey
getDefaultFeeValue()
getDefaultFeeValue(): Promise<{
authority: PublicKey;
buffer1: number[];
buffer2: number[];
buffer3: number[];
streamflowFee: BN;
}>;Defined in: staking/solana/client.ts:225
Returns
Promise<{
authority: PublicKey;
buffer1: number[];
buffer2: number[];
buffer3: number[];
streamflowFee: BN;
}>
getDiscriminator()
getDiscriminator<ProgramName, DecodingProgram, DerivedIdl, AccountName>(programKey, accountName): number[];Defined in: staking/solana/client.ts:861
Type Parameters
| Type Parameter | Default type |
|---|---|
ProgramName extends keyof Programs | keyof Programs |
DecodingProgram | Programs[ProgramName] |
DerivedIdl extends Idl | DecodingProgram extends Program<IDLType> ? IDLType : never |
AccountName extends string | number | symbol | keyof IdlAccounts<DerivedIdl> |
Parameters
| Parameter | Type |
|---|---|
programKey | ProgramName |
accountName | AccountName |
Returns
number[]
getFee()
getFee(target): Promise<
| {
buffer: number[];
streamflowFee: BN;
}
| {
authority: PublicKey;
buffer1: number[];
buffer2: number[];
buffer3: number[];
streamflowFee: BN;
}>;Defined in: staking/solana/client.ts:217
Parameters
| Parameter | Type |
|---|---|
target | string | PublicKey |
Returns
Promise<
| {
buffer: number[];
streamflowFee: BN;
}
| {
authority: PublicKey;
buffer1: number[];
buffer2: number[];
buffer3: number[];
streamflowFee: BN;
}>
getFeeValueIfExists()
getFeeValueIfExists(target): Promise<{
buffer: number[];
streamflowFee: BN;
}>;Defined in: staking/solana/client.ts:231
Parameters
| Parameter | Type |
|---|---|
target | string | PublicKey |
Returns
Promise<{
buffer: number[];
streamflowFee: BN;
}>
getStakeEntry()
getStakeEntry(id): Promise<{
amount: BN;
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
closedTs: BN;
createdTs: BN;
duration: BN;
effectiveAmount: BN;
isSponsored: boolean;
nonce: number;
payer: PublicKey;
priorTotalEffectiveStake: BN;
stakePool: PublicKey;
unstakeTs: BN;
}>;Defined in: staking/solana/client.ts:191
Parameters
| Parameter | Type |
|---|---|
id | string | PublicKey |
Returns
Promise<{
amount: BN;
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
closedTs: BN;
createdTs: BN;
duration: BN;
effectiveAmount: BN;
isSponsored: boolean;
nonce: number;
payer: PublicKey;
priorTotalEffectiveStake: BN;
stakePool: PublicKey;
unstakeTs: BN;
}>
getStakePool()
getStakePool(id): Promise<{
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
bump: number;
creator: PublicKey;
expiryTs: BN;
freezeStakeMint: boolean;
isTotalStakeCapped: boolean;
maxDuration: BN;
maxWeight: BN;
minDuration: BN;
mint: PublicKey;
minWeight: BN;
nonce: number;
permissionless: boolean;
remainingTotalStake: BN;
stakeMint: PublicKey;
totalEffectiveStake: BN;
totalStake: BN;
unstakePeriod: BN;
vault: PublicKey;
}>;Defined in: staking/solana/client.ts:179
Parameters
| Parameter | Type |
|---|---|
id | string | PublicKey |
Returns
Promise<{
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
bump: number;
creator: PublicKey;
expiryTs: BN;
freezeStakeMint: boolean;
isTotalStakeCapped: boolean;
maxDuration: BN;
maxWeight: BN;
minDuration: BN;
mint: PublicKey;
minWeight: BN;
nonce: number;
permissionless: boolean;
remainingTotalStake: BN;
stakeMint: PublicKey;
totalEffectiveStake: BN;
totalStake: BN;
unstakePeriod: BN;
vault: PublicKey;
}>
prepareClaimRewardsInstructions()
prepareClaimRewardsInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:589
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ClaimRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareClawbackInstructions()
prepareClawbackInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:696
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ClawbackRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareCloseRewardEntryInstructions()
prepareCloseRewardEntryInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:763
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CreateRewardEntryArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareCloseStakeEntryInstructions()
prepareCloseStakeEntryInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:522
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CloseStakeEntryArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareCreateFundDelegateInstructions()
prepareCreateFundDelegateInstructions(__namedParameters, extParams): Promise<CreateFundDelegatePrepareResult>;Defined in: staking/solana/client.ts:792
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CreateFundDelegateArgs |
extParams | IInteractExt |
Returns
Promise<CreateFundDelegatePrepareResult>
prepareCreateRewardEntryInstructions()
prepareCreateRewardEntryInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:729
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CreateRewardEntryArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareCreateRewardPoolInstructions()
prepareCreateRewardPoolInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
publicKey: PublicKey;
}>;Defined in: staking/solana/client.ts:548
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CreateRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
publicKey: PublicKey;
}>
prepareCreateStakePoolInstructions()
prepareCreateStakePoolInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
publicKey: PublicKey;
}>;Defined in: staking/solana/client.ts:248
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CreateStakePoolArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
publicKey: PublicKey;
}>
prepareFundPoolInstructions()
prepareFundPoolInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:641
Parameters
| Parameter | Type |
|---|---|
__namedParameters | FundPoolArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareStakeAndCreateEntriesInstructions()
prepareStakeAndCreateEntriesInstructions(data, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:333
Parameters
| Parameter | Type |
|---|---|
data | StakeAndCreateEntriesArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareStakeInstructions()
prepareStakeInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:360
Parameters
| Parameter | Type |
|---|---|
__namedParameters | StakeArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareUnstakeAndClaimInstructions()
prepareUnstakeAndClaimInstructions(data, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:412
Parameters
| Parameter | Type |
|---|---|
data | UnstakeAndCloseArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareUnstakeAndCloseInstructions()
prepareUnstakeAndCloseInstructions(data, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:461
Parameters
| Parameter | Type |
|---|---|
data | UnstakeAndCloseArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareUnstakeInstructions()
prepareUnstakeInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:488
Parameters
| Parameter | Type |
|---|---|
__namedParameters | UnstakeArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
prepareUpdateRewardPoolInstructions()
prepareUpdateRewardPoolInstructions(__namedParameters, extParams): Promise<{
ixs: TransactionInstruction[];
}>;Defined in: staking/solana/client.ts:826
Parameters
| Parameter | Type |
|---|---|
__namedParameters | UpdateRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
}>
searchRewardEntries()
searchRewardEntries(criteria): Promise<ProgramAccount<{
accountedAmount: BN;
buffer: number[];
claimedAmount: BN;
createdTs: BN;
isSponsored: boolean;
lastAccountedTs: BN;
lastRewardAmount: BN;
lastRewardPeriod: BN;
rewardPool: PublicKey;
stakeEntry: PublicKey;
}>[]>;Defined in: staking/solana/client.ts:210
Parameters
| Parameter | Type |
|---|---|
criteria | Partial<Pick<RewardEntry, keyof typeof REWARD_ENTRY_BYTE_OFFSETS>> |
Returns
Promise<ProgramAccount<{
accountedAmount: BN;
buffer: number[];
claimedAmount: BN;
createdTs: BN;
isSponsored: boolean;
lastAccountedTs: BN;
lastRewardAmount: BN;
lastRewardPeriod: BN;
rewardPool: PublicKey;
stakeEntry: PublicKey;
}>[]>
searchRewardPools()
searchRewardPools(criteria?): Promise<ProgramAccount<{
authority: PublicKey;
buffer: number[];
bump: number;
claimedAmount: BN;
clawedBackTs: BN;
createdTs: BN;
creator: PublicKey;
fundedAmount: BN;
lastAmountUpdateTs: BN;
lastClaimPeriod: BN;
lastPeriodUpdateTs: BN;
lastRewardAmount: BN;
lastRewardPeriod: BN;
mint: PublicKey;
nonce: number;
permissionless: boolean;
rewardAmount: BN;
rewardPeriod: BN;
stakePool: PublicKey;
vault: PublicKey;
}>[]>;Defined in: staking/solana/client.ts:203
Parameters
| Parameter | Type |
|---|---|
criteria | Partial<Pick<RewardPool, "stakePool" | "mint">> |
Returns
Promise<ProgramAccount<{
authority: PublicKey;
buffer: number[];
bump: number;
claimedAmount: BN;
clawedBackTs: BN;
createdTs: BN;
creator: PublicKey;
fundedAmount: BN;
lastAmountUpdateTs: BN;
lastClaimPeriod: BN;
lastPeriodUpdateTs: BN;
lastRewardAmount: BN;
lastRewardPeriod: BN;
mint: PublicKey;
nonce: number;
permissionless: boolean;
rewardAmount: BN;
rewardPeriod: BN;
stakePool: PublicKey;
vault: PublicKey;
}>[]>
searchStakeEntries()
searchStakeEntries(criteria?): Promise<ProgramAccount<{
amount: BN;
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
closedTs: BN;
createdTs: BN;
duration: BN;
effectiveAmount: BN;
isSponsored: boolean;
nonce: number;
payer: PublicKey;
priorTotalEffectiveStake: BN;
stakePool: PublicKey;
unstakeTs: BN;
}>[]>;Defined in: staking/solana/client.ts:196
Parameters
| Parameter | Type |
|---|---|
criteria | Partial<Pick<StakeEntry, keyof typeof STAKE_ENTRY_BYTE_OFFSETS>> |
Returns
Promise<ProgramAccount<{
amount: BN;
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
closedTs: BN;
createdTs: BN;
duration: BN;
effectiveAmount: BN;
isSponsored: boolean;
nonce: number;
payer: PublicKey;
priorTotalEffectiveStake: BN;
stakePool: PublicKey;
unstakeTs: BN;
}>[]>
searchStakePools()
searchStakePools(criteria?): Promise<ProgramAccount<{
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
bump: number;
creator: PublicKey;
expiryTs: BN;
freezeStakeMint: boolean;
isTotalStakeCapped: boolean;
maxDuration: BN;
maxWeight: BN;
minDuration: BN;
mint: PublicKey;
minWeight: BN;
nonce: number;
permissionless: boolean;
remainingTotalStake: BN;
stakeMint: PublicKey;
totalEffectiveStake: BN;
totalStake: BN;
unstakePeriod: BN;
vault: PublicKey;
}>[]>;Defined in: staking/solana/client.ts:184
Parameters
| Parameter | Type |
|---|---|
criteria | Partial<Pick<StakePool, keyof typeof STAKE_POOL_BYTE_OFFSETS>> |
Returns
Promise<ProgramAccount<{
authority: PublicKey;
autoUnstake: boolean;
buffer: number[];
bump: number;
creator: PublicKey;
expiryTs: BN;
freezeStakeMint: boolean;
isTotalStakeCapped: boolean;
maxDuration: BN;
maxWeight: BN;
minDuration: BN;
mint: PublicKey;
minWeight: BN;
nonce: number;
permissionless: boolean;
remainingTotalStake: BN;
stakeMint: PublicKey;
totalEffectiveStake: BN;
totalStake: BN;
unstakePeriod: BN;
vault: PublicKey;
}>[]>
stake()
stake(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:305
Parameters
| Parameter | Type |
|---|---|
data | StakeArgs |
extParams | IInteractExt |
Returns
Promise<ITransactionResult>
stakeAndCreateEntries()
stakeAndCreateEntries(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:323
Stake into a Pool and creates Reward Entries to track rewards.
Resulting transaction may bee too large for execution if there are too many reward pools.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | StakeAndCreateEntriesArgs | enriched stake params with an array of reward pools |
extParams | IInteractExt | parameter required for transaction execution |
Returns
Promise<ITransactionResult>
unstake()
unstake(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:384
Parameters
| Parameter | Type |
|---|---|
data | UnstakeArgs |
extParams | IInteractExt |
Returns
Promise<ITransactionResult>
unstakeAndClaim()
unstakeAndClaim(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:402
Unstake from a pool, claiming all rewards prior to that.
Resulting transaction may be too large for execution if there are too many reward pools.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | UnstakeAndCloseArgs | enriched unstake args with reward pools |
extParams | IInteractExt | parameter required for transaction execution |
Returns
Promise<ITransactionResult>
unstakeAndClose()
unstakeAndClose(data, extParams): Promise<ITransactionResult>;Defined in: staking/solana/client.ts:451
Unstake from a pool, closing all related stake and reward entries.
REWARDS WON'T be claimed - use this call only if user can't unstake with rewards claims, i.e. when reward pool is drained.
Resulting transaction may be too large for execution if there are too many reward pools.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | UnstakeAndCloseArgs | enriched unstake args with reward pools |
extParams | IInteractExt | parameter required for transaction execution |
Returns
Promise<ITransactionResult>
updateRewardPool()
updateRewardPool(data, extParams): Promise<{
ixs: TransactionInstruction[];
txId: string;
}>;Defined in: staking/solana/client.ts:816
Parameters
| Parameter | Type |
|---|---|
data | UpdateRewardPoolArgs |
extParams | IInteractExt |
Returns
Promise<{
ixs: TransactionInstruction[];
txId: string;
}>