@glamsystems/glam-sdk 1.0.14-alpha.4 → 1.0.14-alpha.6
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/index.cjs.js +50322 -20832
- package/index.esm.js +50167 -20833
- package/package.json +3 -3
- package/target/idl/ext_jupiter-staging.json +1960 -0
- package/target/idl/ext_jupiter.json +1960 -0
- package/target/idl/ext_orca-staging.json +2797 -0
- package/target/idl/ext_orca.json +2797 -0
- package/target/idl/glam_mint-staging.json +1452 -80
- package/target/idl/glam_mint.json +256 -1
- package/target/idl/glam_protocol-staging.json +22 -2
- package/target/idl/glam_protocol.json +584 -0
- package/target/types/ext_jupiter-staging.ts +1966 -0
- package/target/types/ext_jupiter.ts +1966 -0
- package/target/types/ext_orca-staging.ts +2803 -0
- package/target/types/ext_orca.ts +2803 -0
- package/target/types/glam_mint-staging.ts +1452 -80
- package/target/types/glam_mint.ts +256 -1
- package/target/types/glam_protocol-staging.ts +22 -2
- package/target/types/glam_protocol.ts +584 -0
- package/src/assets.d.ts +0 -40
- package/src/client/access.d.ts +0 -57
- package/src/client/base.d.ts +0 -180
- package/src/client/bridge.d.ts +0 -185
- package/src/client/bridgeRegistry.d.ts +0 -32
- package/src/client/cctp.d.ts +0 -156
- package/src/client/epi.d.ts +0 -78
- package/src/client/fees.d.ts +0 -33
- package/src/client/invest.d.ts +0 -37
- package/src/client/jupiter.d.ts +0 -45
- package/src/client/kamino/farm.d.ts +0 -39
- package/src/client/kamino/index.d.ts +0 -4
- package/src/client/kamino/lending.d.ts +0 -86
- package/src/client/kamino/types.d.ts +0 -56
- package/src/client/kamino/vaults.d.ts +0 -31
- package/src/client/marinade.d.ts +0 -42
- package/src/client/mint.d.ts +0 -127
- package/src/client/price.d.ts +0 -128
- package/src/client/stake-pool.d.ts +0 -39
- package/src/client/stake.d.ts +0 -34
- package/src/client/state.d.ts +0 -56
- package/src/client/timelock.d.ts +0 -31
- package/src/client/vault.d.ts +0 -90
- package/src/client.d.ts +0 -62
- package/src/clientConfig.d.ts +0 -29
- package/src/constants.d.ts +0 -82
- package/src/deser/base.d.ts +0 -18
- package/src/deser/index.d.ts +0 -3
- package/src/deser/integrationPolicies.d.ts +0 -106
- package/src/deser/kaminoLayouts.d.ts +0 -264
- package/src/deser/tokenAclLayouts.d.ts +0 -67
- package/src/error.d.ts +0 -29
- package/src/glamExports.d.ts +0 -5563
- package/src/globalConfig.d.ts +0 -22
- package/src/index.d.ts +0 -18
- package/src/models/acl.d.ts +0 -43
- package/src/models/index.d.ts +0 -8
- package/src/models/mint.d.ts +0 -64
- package/src/models/state.d.ts +0 -104
- package/src/models/types.d.ts +0 -28
- package/src/react/cluster-provider.d.ts +0 -22
- package/src/react/glam.d.ts +0 -47
- package/src/react/index.d.ts +0 -5
- package/src/react/query-keys.d.ts +0 -38
- package/src/react/useVaultBalanceSubscription.d.ts +0 -17
- package/src/utils/accounts.d.ts +0 -72
- package/src/utils/bitmask.d.ts +0 -53
- package/src/utils/blockhash.d.ts +0 -11
- package/src/utils/common.d.ts +0 -37
- package/src/utils/computeBudget.d.ts +0 -15
- package/src/utils/evm.d.ts +0 -10
- package/src/utils/fraction.d.ts +0 -29
- package/src/utils/glamPDAs.d.ts +0 -14
- package/src/utils/index.d.ts +0 -16
- package/src/utils/jupiterApi.d.ts +0 -89
- package/src/utils/lookupTables.d.ts +0 -53
- package/src/utils/pkmap.d.ts +0 -82
- package/src/utils/pkset.d.ts +0 -73
- package/src/utils/positionCategorizer.d.ts +0 -36
- package/src/utils/rpc.d.ts +0 -33
- package/src/utils/timelock.d.ts +0 -52
- package/src/utils/transaction.d.ts +0 -13
- package/target/types/ext_bridge.d.ts +0 -2385
- package/target/types/ext_cctp.d.ts +0 -1268
- package/target/types/ext_epi.d.ts +0 -2175
- package/target/types/ext_kamino.d.ts +0 -3433
- package/target/types/ext_marinade.d.ts +0 -1593
- package/target/types/ext_spl.d.ts +0 -1274
- package/target/types/ext_stake_pool.d.ts +0 -1622
- package/target/types/glam_config.d.ts +0 -755
- package/target/types/glam_mint.d.ts +0 -6094
- package/target/types/glam_protocol.d.ts +0 -2708
package/src/client/invest.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
|
|
4
|
-
import { PendingRequest } from "../models";
|
|
5
|
-
declare class TxBuilder extends BaseTxBuilder<InvestClient> {
|
|
6
|
-
subscribeIxs(amount: BN, signer: PublicKey): Promise<TransactionInstruction[]>;
|
|
7
|
-
subscribeTx(amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
8
|
-
queuedSubscribeIxs(amount: BN, signer: PublicKey): Promise<TransactionInstruction[]>;
|
|
9
|
-
queuedSubscribeTx(amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
10
|
-
queuedRedeemIx(amount: BN, signer: PublicKey): Promise<TransactionInstruction>;
|
|
11
|
-
queuedRedeemTx(amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
12
|
-
cancelIx(pubkey: PublicKey | null, signer: PublicKey): Promise<TransactionInstruction>;
|
|
13
|
-
cancelTx(pubkey: PublicKey | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
14
|
-
fulfillIx(limit: number | null, signer: PublicKey): Promise<TransactionInstruction>;
|
|
15
|
-
fulfillTx(limit: number | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
16
|
-
claimIxs(user: PublicKey | null, signer: PublicKey): Promise<TransactionInstruction[]>;
|
|
17
|
-
claimTx(user: PublicKey | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
18
|
-
}
|
|
19
|
-
export declare class InvestClient {
|
|
20
|
-
readonly base: BaseClient;
|
|
21
|
-
readonly txBuilder: TxBuilder;
|
|
22
|
-
constructor(base: BaseClient);
|
|
23
|
-
subscribe(amount: BN, queued?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
24
|
-
queuedRedeem(amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
25
|
-
cancel(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
26
|
-
cancelForUser(user: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
27
|
-
fulfill(limit: number | null, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
28
|
-
/**
|
|
29
|
-
* Claims the pending request for the signer.
|
|
30
|
-
* @param txOptions
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
claim(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
34
|
-
claimForUser(user: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
35
|
-
fetchPendingRequest(user?: PublicKey): Promise<PendingRequest | null>;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
package/src/client/jupiter.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
|
|
4
|
-
import { VaultClient } from "./vault";
|
|
5
|
-
import { JupiterApiClient, JupiterInstruction, QuoteParams, QuoteResponse, SwapInstructions } from "../utils/jupiterApi";
|
|
6
|
-
import { KaminoLendingClient } from "./kamino";
|
|
7
|
-
export type JupiterSwapOptions = {
|
|
8
|
-
quoteParams?: QuoteParams;
|
|
9
|
-
quoteResponse?: QuoteResponse;
|
|
10
|
-
swapInstructions?: SwapInstructions;
|
|
11
|
-
trackingAccount?: PublicKey;
|
|
12
|
-
};
|
|
13
|
-
export type JupiterSwapV2OracleAccounts = {
|
|
14
|
-
solUsdOracle?: PublicKey;
|
|
15
|
-
inputTokenOracle?: PublicKey;
|
|
16
|
-
outputTokenOracle?: PublicKey;
|
|
17
|
-
kaminoReservesToRefresh: PublicKey[];
|
|
18
|
-
};
|
|
19
|
-
export type JupiterSwapV2Options = JupiterSwapOptions & {
|
|
20
|
-
skipQuotePriceCheck?: boolean;
|
|
21
|
-
oracleAccounts?: JupiterSwapV2OracleAccounts;
|
|
22
|
-
};
|
|
23
|
-
declare class TxBuilder extends BaseTxBuilder<JupiterSwapClient> {
|
|
24
|
-
private resolveSwapInstructionContext;
|
|
25
|
-
/**
|
|
26
|
-
* Returns the instructions for a Jupiter swap and the lookup tables
|
|
27
|
-
*/
|
|
28
|
-
swapIxs(options: JupiterSwapOptions, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey[]]>;
|
|
29
|
-
swapV2Ixs(options: JupiterSwapV2Options, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey[]]>;
|
|
30
|
-
swapTx(options: JupiterSwapOptions, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
31
|
-
swapV2Tx(options: JupiterSwapV2Options, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
32
|
-
getPreInstructions: (signer: PublicKey, inputMint: PublicKey, outputMint: PublicKey, amount: BN, outputTokenProgram?: PublicKey) => Promise<TransactionInstruction[]>;
|
|
33
|
-
toTransactionInstruction: (ix: JupiterInstruction) => TransactionInstruction;
|
|
34
|
-
}
|
|
35
|
-
export declare class JupiterSwapClient {
|
|
36
|
-
readonly base: BaseClient;
|
|
37
|
-
readonly vault: VaultClient;
|
|
38
|
-
readonly klend: KaminoLendingClient;
|
|
39
|
-
readonly txBuilder: TxBuilder;
|
|
40
|
-
readonly jupApi: JupiterApiClient;
|
|
41
|
-
constructor(base: BaseClient, vault: VaultClient, klend: KaminoLendingClient);
|
|
42
|
-
swap(options: JupiterSwapOptions, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
43
|
-
swapV2(options: JupiterSwapV2Options, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, VersionedTransaction, TransactionSignature } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "../base";
|
|
4
|
-
import { PkMap } from "../../utils";
|
|
5
|
-
import { KaminoLendingClient } from "./lending";
|
|
6
|
-
import { ParsedFarmState, ParsedFarmUser } from "./types";
|
|
7
|
-
declare class TxBuilder extends BaseTxBuilder<KaminoFarmClient> {
|
|
8
|
-
stakeTx(amount: BN, farmState: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
9
|
-
unstakeTx(amount: BN, farmState: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
10
|
-
harvestTx(farmUserStates: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
11
|
-
}
|
|
12
|
-
export declare class KaminoFarmClient {
|
|
13
|
-
readonly base: BaseClient;
|
|
14
|
-
readonly kaminoLending: KaminoLendingClient;
|
|
15
|
-
txBuilder: TxBuilder;
|
|
16
|
-
constructor(base: BaseClient, kaminoLending: KaminoLendingClient);
|
|
17
|
-
/**
|
|
18
|
-
* Finds and parses farm states for the given owner
|
|
19
|
-
*/
|
|
20
|
-
findAndParseFarmUserStates(owner: PublicKey): Promise<ParsedFarmUser[]>;
|
|
21
|
-
parseFarmState(data: Buffer): Promise<ParsedFarmState>;
|
|
22
|
-
fetchAndParseFarmStates(farms: PublicKey[]): Promise<PkMap<ParsedFarmState>>;
|
|
23
|
-
farmVaultTokenAccount: (farm: PublicKey, mint: PublicKey) => PublicKey;
|
|
24
|
-
farmVaultsAuthority: (farm: PublicKey) => PublicKey;
|
|
25
|
-
rewardsTreasuryVault: (globalConfig: PublicKey, mint: PublicKey) => PublicKey;
|
|
26
|
-
/**
|
|
27
|
-
* Harvest rewards from Kamino farms
|
|
28
|
-
*/
|
|
29
|
-
harvest(vaultFarmStates: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
30
|
-
/**
|
|
31
|
-
* Stake tokens to a farm
|
|
32
|
-
*/
|
|
33
|
-
stake(amount: BN, farmState: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
34
|
-
/**
|
|
35
|
-
* Unstake tokens from a farm
|
|
36
|
-
*/
|
|
37
|
-
unstake(amount: BN, farmState: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, VersionedTransaction, TransactionSignature, TransactionInstruction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "../base";
|
|
4
|
-
import { Reserve, Obligation } from "../../deser/kaminoLayouts";
|
|
5
|
-
import { VaultClient } from "../vault";
|
|
6
|
-
import { RefreshObligationAccounts, RefreshReserveAccounts, RefreshObligationFarmsForReserveArgs, RefreshObligationFarmsForReserveAccounts } from "./types";
|
|
7
|
-
declare class TxBuilder extends BaseTxBuilder<KaminoLendingClient> {
|
|
8
|
-
refreshObligationIx(accounts: RefreshObligationAccounts): TransactionInstruction;
|
|
9
|
-
refreshReserveIx(accounts: RefreshReserveAccounts): TransactionInstruction;
|
|
10
|
-
refreshObligationFarmsForReserveIx(args: RefreshObligationFarmsForReserveArgs, accounts: RefreshObligationFarmsForReserveAccounts): TransactionInstruction;
|
|
11
|
-
refreshReservesBatchIx(reserves: Reserve[], skipPriceUpdates: boolean): TransactionInstruction;
|
|
12
|
-
refreshReservesIxs(reserves: Reserve[]): TransactionInstruction[];
|
|
13
|
-
refreshObligationCollateralFarmsForReservesIxs(obligation: PublicKey, reserves: Reserve[]): TransactionInstruction[];
|
|
14
|
-
refreshObligationDebtFarmsForReservesIxs(obligation: PublicKey, reserves: Reserve[]): TransactionInstruction[];
|
|
15
|
-
/**
|
|
16
|
-
* Returns two instructions that refresh reserves in batch and refresh obligation
|
|
17
|
-
*/
|
|
18
|
-
refreshReservesAndObligationIxs(obligation: PublicKey, targetReserve: Reserve): Promise<TransactionInstruction[]>;
|
|
19
|
-
/**
|
|
20
|
-
* Returns an instruction to initialize obligation farm user if it doesn't exist
|
|
21
|
-
*
|
|
22
|
-
* @param mode 0 collateral farm, 1 debt farm
|
|
23
|
-
*/
|
|
24
|
-
initObligationFarmUserForReserveIx(obligation: PublicKey, reserve: Reserve, mode: 0 | 1, signer?: PublicKey): Promise<{
|
|
25
|
-
farmUser: null;
|
|
26
|
-
initIx: null;
|
|
27
|
-
} | {
|
|
28
|
-
farmUser: PublicKey;
|
|
29
|
-
initIx: TransactionInstruction | null;
|
|
30
|
-
}>;
|
|
31
|
-
initUserMetadataTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
32
|
-
depositIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
33
|
-
depositTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
34
|
-
withdrawIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
35
|
-
withdrawTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
36
|
-
borrowIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
37
|
-
borrowTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
38
|
-
requestElevationGroupIxs(lendingMarket: PublicKey, elevationGroup: number, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
39
|
-
requestElevationGroupTx(lendingMarket: PublicKey, elevationGroup: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
40
|
-
repayIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
41
|
-
repayTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
42
|
-
}
|
|
43
|
-
export declare class KaminoLendingClient {
|
|
44
|
-
readonly base: BaseClient;
|
|
45
|
-
readonly vault: VaultClient;
|
|
46
|
-
private reserves;
|
|
47
|
-
private obligations;
|
|
48
|
-
txBuilder: TxBuilder;
|
|
49
|
-
constructor(base: BaseClient, vault: VaultClient);
|
|
50
|
-
/**
|
|
51
|
-
* Initializes Kamino user metadata
|
|
52
|
-
*/
|
|
53
|
-
initUserMetadata(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
54
|
-
/**
|
|
55
|
-
* Deposits asset to the lending market.
|
|
56
|
-
*/
|
|
57
|
-
deposit(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
58
|
-
/**
|
|
59
|
-
* Withdraws asset from the lending market.
|
|
60
|
-
*/
|
|
61
|
-
withdraw(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
62
|
-
/**
|
|
63
|
-
* Borrows asset from the lending market.
|
|
64
|
-
*/
|
|
65
|
-
borrow(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
66
|
-
/**
|
|
67
|
-
* Requests an elevation group for an obligation.
|
|
68
|
-
*/
|
|
69
|
-
requestElevationGroup(market: PublicKey | string, elevationGroup: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
70
|
-
/**
|
|
71
|
-
* Repays asset to the lending market.
|
|
72
|
-
*/
|
|
73
|
-
repay(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
74
|
-
getUserMetadataPda(owner: PublicKey): PublicKey;
|
|
75
|
-
getObligationPda(owner: PublicKey, market: PublicKey, args?: {
|
|
76
|
-
tag: number;
|
|
77
|
-
id: number;
|
|
78
|
-
}): PublicKey;
|
|
79
|
-
getFarmUserState(farmUser: PublicKey, farm: PublicKey): PublicKey;
|
|
80
|
-
getMarketAuthority(market: PublicKey): PublicKey;
|
|
81
|
-
fetchAndParseObligation(obligation: PublicKey): Promise<Obligation>;
|
|
82
|
-
fetchAndParseReserves(reserves: PublicKey[]): Promise<Reserve[]>;
|
|
83
|
-
findAndParseReserve(market: PublicKey, asset: PublicKey): Promise<Reserve>;
|
|
84
|
-
findAndParseObligations(owner: PublicKey, market?: PublicKey): Promise<Obligation[]>;
|
|
85
|
-
}
|
|
86
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey } from "@solana/web3.js";
|
|
3
|
-
export declare const DEFAULT_OBLIGATION_ARGS: {
|
|
4
|
-
tag: number;
|
|
5
|
-
id: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const KAMINO_VAULTS_EVENT_AUTHORITY: PublicKey;
|
|
8
|
-
export interface RefreshObligationAccounts {
|
|
9
|
-
lendingMarket: PublicKey;
|
|
10
|
-
obligation: PublicKey;
|
|
11
|
-
reserves: PublicKey[];
|
|
12
|
-
}
|
|
13
|
-
export interface RefreshReserveAccounts {
|
|
14
|
-
reserve: PublicKey;
|
|
15
|
-
lendingMarket: PublicKey;
|
|
16
|
-
pythOracle: PublicKey;
|
|
17
|
-
switchboardPriceOracle: PublicKey;
|
|
18
|
-
switchboardTwapOracle: PublicKey;
|
|
19
|
-
scopePrices: PublicKey;
|
|
20
|
-
}
|
|
21
|
-
export interface RefreshObligationFarmsForReserveArgs {
|
|
22
|
-
mode: number;
|
|
23
|
-
}
|
|
24
|
-
export interface RefreshObligationFarmsForReserveAccounts {
|
|
25
|
-
crank: PublicKey;
|
|
26
|
-
baseAccounts: {
|
|
27
|
-
obligation: PublicKey;
|
|
28
|
-
lendingMarketAuthority: PublicKey;
|
|
29
|
-
reserve: PublicKey;
|
|
30
|
-
reserveFarmState: PublicKey;
|
|
31
|
-
obligationFarmUserState: PublicKey;
|
|
32
|
-
lendingMarket: PublicKey;
|
|
33
|
-
};
|
|
34
|
-
farmsProgram: PublicKey;
|
|
35
|
-
rent: PublicKey;
|
|
36
|
-
systemProgram: PublicKey;
|
|
37
|
-
}
|
|
38
|
-
export interface ParsedFarmState {
|
|
39
|
-
globalConfig: PublicKey;
|
|
40
|
-
farmTokenMint: PublicKey;
|
|
41
|
-
farmTokenDecimals: BN;
|
|
42
|
-
farmTokenProgram: PublicKey;
|
|
43
|
-
farmVault: PublicKey;
|
|
44
|
-
rewards: {
|
|
45
|
-
index: number;
|
|
46
|
-
mint: PublicKey;
|
|
47
|
-
minClaimDurationSeconds: BN;
|
|
48
|
-
tokenProgram: PublicKey;
|
|
49
|
-
rewardsVault: PublicKey;
|
|
50
|
-
}[];
|
|
51
|
-
}
|
|
52
|
-
export interface ParsedFarmUser {
|
|
53
|
-
pubkey: PublicKey;
|
|
54
|
-
farmState: PublicKey;
|
|
55
|
-
unclaimedRewards: BN[];
|
|
56
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, VersionedTransaction, TransactionSignature, AccountMeta, Commitment } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "../base";
|
|
4
|
-
import { KVaultAllocation, KVaultState } from "../../deser/kaminoLayouts";
|
|
5
|
-
import { KaminoLendingClient } from "./lending";
|
|
6
|
-
declare class TxBuilder extends BaseTxBuilder<KaminoVaultsClient> {
|
|
7
|
-
depositTx(vault: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
8
|
-
withdrawTx(vault: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
9
|
-
}
|
|
10
|
-
export declare class KaminoVaultsClient {
|
|
11
|
-
readonly base: BaseClient;
|
|
12
|
-
readonly kaminoLending: KaminoLendingClient;
|
|
13
|
-
private vaultStates;
|
|
14
|
-
private shareMintToVaultPdaMap;
|
|
15
|
-
txBuilder: TxBuilder;
|
|
16
|
-
constructor(base: BaseClient, kaminoLending: KaminoLendingClient);
|
|
17
|
-
/**
|
|
18
|
-
* Deposit to a Kamino vault
|
|
19
|
-
*/
|
|
20
|
-
deposit(vault: PublicKey, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
21
|
-
/**
|
|
22
|
-
* Withdraw from a Kamino vault
|
|
23
|
-
*/
|
|
24
|
-
withdraw(vault: PublicKey, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
25
|
-
findAndParseKaminoVaults(commitment?: Commitment): Promise<KVaultState[]>;
|
|
26
|
-
get globalConfigPda(): PublicKey;
|
|
27
|
-
getVaultPdasByShareMints(mints: PublicKey[]): Promise<PublicKey[]>;
|
|
28
|
-
fetchAndParseVaultState(vault: PublicKey): Promise<KVaultState>;
|
|
29
|
-
composeRemainingAccounts(allocations: KVaultAllocation[], pricingMode?: boolean): Promise<AccountMeta[]>;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
package/src/client/marinade.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, VersionedTransaction, TransactionSignature, TransactionInstruction, Keypair } from "@solana/web3.js";
|
|
3
|
-
import { MarinadeState } from "@marinade.finance/marinade-ts-sdk";
|
|
4
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
|
|
5
|
-
import { StakeAccountInfo } from "../utils/accounts";
|
|
6
|
-
import { StakeClient } from "./stake";
|
|
7
|
-
export type Ticket = {
|
|
8
|
-
address: PublicKey;
|
|
9
|
-
lamports: number;
|
|
10
|
-
createdEpoch: number;
|
|
11
|
-
isDue: boolean;
|
|
12
|
-
isClaimable: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare class TxBuilder extends BaseTxBuilder<MarinadeClient> {
|
|
15
|
-
depositIxs(amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
16
|
-
depositTx(amount: BN, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
17
|
-
depositNativeIxs(amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
18
|
-
depositNativeTx(amount: BN, txOptions: TxOptions): Promise<any>;
|
|
19
|
-
depositStakeAccountIx(stakeAccount: PublicKey, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
20
|
-
depositStakeAccountTx(stakeAccount: PublicKey, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
21
|
-
withdrawStakeAccountIxs(amount: BN, deactivate: boolean | undefined, glamSigner: PublicKey): Promise<[TransactionInstruction[], Keypair]>;
|
|
22
|
-
withdrawStakeAccountTx(amount: BN, deactivate: boolean | undefined, txOptions: TxOptions): Promise<[VersionedTransaction, Keypair]>;
|
|
23
|
-
}
|
|
24
|
-
export declare class MarinadeClient {
|
|
25
|
-
readonly base: BaseClient;
|
|
26
|
-
readonly stake: StakeClient;
|
|
27
|
-
private marinadeState;
|
|
28
|
-
txBuilder: TxBuilder;
|
|
29
|
-
constructor(base: BaseClient, stake: StakeClient);
|
|
30
|
-
deposit(amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
31
|
-
depositNative(amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
32
|
-
depositStakeAccount(stakeAccount: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
33
|
-
withdrawStakeAccount(amount: BN, deactivate?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
34
|
-
fetchMarinadeState(): Promise<MarinadeState>;
|
|
35
|
-
getParsedStakeAccountInfo(stakeAccount: PublicKey): Promise<any>;
|
|
36
|
-
parseAccountList(data: Buffer, itemSize: number): PublicKey[];
|
|
37
|
-
getIndexes(stakeAccount: StakeAccountInfo, stakeList: any, validatorList: any): Promise<{
|
|
38
|
-
stakeIndex: number;
|
|
39
|
-
validatorIndex: number;
|
|
40
|
-
}>;
|
|
41
|
-
}
|
|
42
|
-
export {};
|
package/src/client/mint.d.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { Connection, PublicKey, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TokenAccount, TxOptions } from "./base";
|
|
4
|
-
import { PriceClient } from "./price";
|
|
5
|
-
import { MintIdlModel, RequestType, StateAccountType } from "../models";
|
|
6
|
-
import { UpdateStateParams } from "./state";
|
|
7
|
-
export type InitMintParams = {
|
|
8
|
-
accountType: StateAccountType;
|
|
9
|
-
name: number[];
|
|
10
|
-
symbol: string;
|
|
11
|
-
uri: string;
|
|
12
|
-
baseAssetMint: PublicKey;
|
|
13
|
-
decimals?: number;
|
|
14
|
-
} & Partial<MintIdlModel>;
|
|
15
|
-
export type UpdateMintParams = {
|
|
16
|
-
permanentDelegate?: PublicKey;
|
|
17
|
-
defaultAccountStateFrozen?: boolean;
|
|
18
|
-
lockupPeriod?: number;
|
|
19
|
-
maxCap?: BN;
|
|
20
|
-
minSubscription?: BN;
|
|
21
|
-
minRedemption?: BN;
|
|
22
|
-
allowlist?: PublicKey[];
|
|
23
|
-
blocklist?: PublicKey[];
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Resolves the list config + wallet entry pairs needed for permissionless thaw.
|
|
27
|
-
* Returns empty array if Token ACL is not enabled or no matching pairs found.
|
|
28
|
-
*/
|
|
29
|
-
export declare function resolveThawAccounts(connection: Connection, mintPda: PublicKey, wallet: PublicKey): Promise<{
|
|
30
|
-
listConfig: PublicKey;
|
|
31
|
-
walletEntry: PublicKey;
|
|
32
|
-
}[]>;
|
|
33
|
-
/**
|
|
34
|
-
* Builds a permissionless thaw instruction for the Token ACL program.
|
|
35
|
-
* Standalone version of TxBuilder.thawPermissionlessIx for use outside
|
|
36
|
-
* the MintClient context (e.g., in invest.ts).
|
|
37
|
-
*/
|
|
38
|
-
export declare function buildThawPermissionlessIx(mintPda: PublicKey, wallet: PublicKey, listAndWalletPairs: {
|
|
39
|
-
listConfig: PublicKey;
|
|
40
|
-
walletEntry: PublicKey;
|
|
41
|
-
}[], signer: PublicKey): TransactionInstruction;
|
|
42
|
-
declare class TxBuilder extends BaseTxBuilder<MintClient> {
|
|
43
|
-
setTokenAccountsStatesIx(tokenAccounts: PublicKey[], frozen: boolean, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
44
|
-
setTokenAccountsStatesTx(tokenAccounts: PublicKey[], frozen: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
45
|
-
createTokenAccountIxs(owner: PublicKey, setFrozen: boolean, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
46
|
-
createTokenAccountTx(owner: PublicKey, setFrozen?: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
47
|
-
mintIxs(recipient: PublicKey, amount: BN, forceThaw: boolean | undefined, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
48
|
-
mintTx(recipient: PublicKey, amount: BN, forceThaw?: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
49
|
-
burnIxs(from: PublicKey, amount: BN, forceThaw: boolean, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
50
|
-
burnTx(from: PublicKey, amount: BN, forceThaw?: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
51
|
-
forceTransferIxs(from: PublicKey, to: PublicKey, amount: BN, forceThaw: boolean, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
52
|
-
forceTransferTx(from: PublicKey, to: PublicKey, amount: BN, forceThaw?: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
53
|
-
initializeIxs(initMintParams: InitMintParams, stateParams: UpdateStateParams | null, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey]>;
|
|
54
|
-
initializeTx(initMintParams: InitMintParams, stateParams: UpdateStateParams | null, txOptions?: TxOptions): Promise<[VersionedTransaction, PublicKey]>;
|
|
55
|
-
crystallizeFeesIxs(glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
56
|
-
updateIx(mintModel: Partial<MintIdlModel>, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
57
|
-
updateTx(mintModel: Partial<MintIdlModel>, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
58
|
-
emergencyUpdateIx(requestType: RequestType, setPaused: boolean, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
59
|
-
pauseSubscriptionTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
60
|
-
unpauseSubscriptionTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
61
|
-
pauseRedemptionTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
62
|
-
unpauseRedemptionTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
63
|
-
closeMintIx(signer?: PublicKey): Promise<TransactionInstruction>;
|
|
64
|
-
closeMintTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
65
|
-
enableTokenAclIx(gatingProgram: PublicKey | undefined, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
66
|
-
enableTokenAclTx(gatingProgram: PublicKey | undefined, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
67
|
-
aclGateCreateListIx(seed: Buffer, mode: number, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
68
|
-
aclGateCreateListTx(seed: Buffer, mode: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
69
|
-
aclGateAddWalletIx(listConfig: PublicKey, wallet: PublicKey, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
70
|
-
aclGateAddWalletTx(listConfig: PublicKey, wallet: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
71
|
-
aclGateRemoveWalletIx(listConfig: PublicKey, walletEntry: PublicKey, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
72
|
-
aclGateRemoveWalletTx(listConfig: PublicKey, walletEntry: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
73
|
-
aclGateDeleteListIx(listConfig: PublicKey, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
74
|
-
aclGateDeleteListTx(listConfig: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
75
|
-
aclGateSetupExtraMetasIx(listConfigs: PublicKey[], glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
76
|
-
aclGateSetupExtraMetasTx(listConfigs: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
77
|
-
tokenAclFreezeIx(tokenAccounts: PublicKey[], glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
78
|
-
tokenAclFreezeTx(tokenAccounts: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
79
|
-
tokenAclThawIx(tokenAccounts: PublicKey[], glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
80
|
-
tokenAclThawTx(tokenAccounts: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
81
|
-
thawPermissionlessIx(wallet: PublicKey, listAndWalletPairs: {
|
|
82
|
-
listConfig: PublicKey;
|
|
83
|
-
walletEntry: PublicKey;
|
|
84
|
-
}[], signer: PublicKey): TransactionInstruction;
|
|
85
|
-
thawPermissionlessTx(wallet: PublicKey, listAndWalletPairs: {
|
|
86
|
-
listConfig: PublicKey;
|
|
87
|
-
walletEntry: PublicKey;
|
|
88
|
-
}[], txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
89
|
-
}
|
|
90
|
-
export declare class MintClient {
|
|
91
|
-
readonly base: BaseClient;
|
|
92
|
-
private readonly getPrice?;
|
|
93
|
-
readonly txBuilder: TxBuilder;
|
|
94
|
-
constructor(base: BaseClient, getPrice?: (() => PriceClient) | undefined);
|
|
95
|
-
get price(): PriceClient;
|
|
96
|
-
/**
|
|
97
|
-
* Fetches token holders of the GLAM mint using helius RPC
|
|
98
|
-
*/
|
|
99
|
-
fetchTokenHolders(showZeroBalance?: boolean): Promise<TokenAccount[]>;
|
|
100
|
-
getHolders(showZeroBalance?: boolean): Promise<TokenAccount[]>;
|
|
101
|
-
initialize(initMintParams: InitMintParams, txOptions?: TxOptions): Promise<string>;
|
|
102
|
-
initializeWithStateParams(initMintParams: InitMintParams, stateParams: UpdateStateParams, txOptions?: TxOptions): Promise<string>;
|
|
103
|
-
update(mintModel: Partial<MintIdlModel>, txOptions?: TxOptions): Promise<string>;
|
|
104
|
-
pauseSubscription(txOptions?: TxOptions): Promise<string>;
|
|
105
|
-
unpauseSubscription(txOptions?: TxOptions): Promise<string>;
|
|
106
|
-
pauseRedemption(txOptions?: TxOptions): Promise<string>;
|
|
107
|
-
unpauseRedemption(txOptions?: TxOptions): Promise<string>;
|
|
108
|
-
close(txOptions?: TxOptions): Promise<string>;
|
|
109
|
-
mint(to: PublicKey, amount: BN | number, unfreeze?: boolean, txOptions?: TxOptions): Promise<string>;
|
|
110
|
-
burn(from: PublicKey, amount: BN | number, unfreeze?: boolean, txOptions?: TxOptions): Promise<string>;
|
|
111
|
-
createTokenAccount(owner: PublicKey, setFrozen: boolean, txOptions?: TxOptions): Promise<string>;
|
|
112
|
-
setTokenAccountsStates(tokenAccounts: PublicKey[], frozen: boolean, txOptions?: TxOptions): Promise<string>;
|
|
113
|
-
enableTokenAcl(gatingProgram?: PublicKey, txOptions?: TxOptions): Promise<string>;
|
|
114
|
-
forceTransfer(from: PublicKey, to: PublicKey, amount: BN | number, unfreeze?: boolean, txOptions?: TxOptions): Promise<string>;
|
|
115
|
-
tokenAclFreeze(tokenAccounts: PublicKey[], txOptions?: TxOptions): Promise<string>;
|
|
116
|
-
tokenAclThaw(tokenAccounts: PublicKey[], txOptions?: TxOptions): Promise<string>;
|
|
117
|
-
aclGateCreateList(seed: Buffer, mode?: number, txOptions?: TxOptions): Promise<string>;
|
|
118
|
-
aclGateAddWallet(listConfig: PublicKey, wallet: PublicKey, txOptions?: TxOptions): Promise<string>;
|
|
119
|
-
aclGateRemoveWallet(listConfig: PublicKey, walletEntry: PublicKey, txOptions?: TxOptions): Promise<string>;
|
|
120
|
-
aclGateDeleteList(listConfig: PublicKey, txOptions?: TxOptions): Promise<string>;
|
|
121
|
-
aclGateSetupExtraMetas(listConfigs: PublicKey[], txOptions?: TxOptions): Promise<string>;
|
|
122
|
-
thawPermissionless(wallet: PublicKey, listAndWalletPairs: {
|
|
123
|
-
listConfig: PublicKey;
|
|
124
|
-
walletEntry: PublicKey;
|
|
125
|
-
}[], txOptions?: TxOptions): Promise<string>;
|
|
126
|
-
}
|
|
127
|
-
export {};
|
package/src/client/price.d.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { AccountMeta, Commitment, PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
2
|
-
import { BN } from "@coral-xyz/anchor";
|
|
3
|
-
import { KaminoLendingClient, KaminoVaultsClient } from "./kamino";
|
|
4
|
-
import { BaseClient } from "./base";
|
|
5
|
-
import { StateModel } from "../models";
|
|
6
|
-
import { PkMap, PkSet } from "../utils";
|
|
7
|
-
import { KVaultState, Reserve } from "../deser";
|
|
8
|
-
import { JupiterApiClient, TokenListItem } from "../utils/jupiterApi";
|
|
9
|
-
import { BridgeClient } from "./bridge";
|
|
10
|
-
/**
|
|
11
|
-
* Represents a single asset holding within a vault.
|
|
12
|
-
*
|
|
13
|
-
* @param mintAddress - The SPL token mint address of the held asset
|
|
14
|
-
* @param decimals - Number of decimal places for the token (e.g., 6 for USDC, 9 for SOL)
|
|
15
|
-
* @param amount - Unsigned token amount in native units; direction (deposit/borrow) is in protocolMeta
|
|
16
|
-
* @param price - Current price of the asset denominated in the base asset (e.g., USD, SOL)
|
|
17
|
-
* @param priceMeta - Additional pricing context (e.g., source, slot, base asset). Default base asset, if not specified, is USD.
|
|
18
|
-
* @param protocol - Protocol identifier where the asset is allocated
|
|
19
|
-
* @param protocolMeta - Protocol-specific metadata (e.g., market index, position direction, reserve address)
|
|
20
|
-
*/
|
|
21
|
-
export declare class Holding {
|
|
22
|
-
readonly mintAddress: PublicKey;
|
|
23
|
-
readonly decimals: number;
|
|
24
|
-
readonly amount: BN;
|
|
25
|
-
readonly price: number;
|
|
26
|
-
readonly priceMeta: Record<string, any>;
|
|
27
|
-
readonly protocol: string;
|
|
28
|
-
readonly protocolMeta: Record<string, any>;
|
|
29
|
-
readonly uiAmount: number;
|
|
30
|
-
constructor(mintAddress: PublicKey, decimals: number, amount: BN, price: number, priceMeta: Record<string, any> | undefined, protocol: string, protocolMeta?: Record<string, any>);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Aggregates all holdings for a GLAM vault.
|
|
34
|
-
* Includes token balances and supported DeFi positions.
|
|
35
|
-
*
|
|
36
|
-
* @param vaultState - The vault's state account address (stores vault configuration)
|
|
37
|
-
* @param vaultPda - The vault's PDA that holds tokens and positions
|
|
38
|
-
* @param priceBaseAssetMint - The base asset mint used for pricing (e.g., PublicKey.default for USD, So11111111111111111111111111111111111111112 for SOL)
|
|
39
|
-
* @param slot - The Solana slot at which holdings were fetched
|
|
40
|
-
* @param timestamp - Unix timestamp (seconds) when holdings were fetched
|
|
41
|
-
* @param commitment - The Solana commitment level used for fetching account data
|
|
42
|
-
*/
|
|
43
|
-
export declare class VaultHoldings {
|
|
44
|
-
readonly vaultState: PublicKey;
|
|
45
|
-
readonly vaultPda: PublicKey;
|
|
46
|
-
readonly priceBaseAssetMint: PublicKey;
|
|
47
|
-
readonly slot: number;
|
|
48
|
-
readonly timestamp: number;
|
|
49
|
-
readonly commitment: Commitment;
|
|
50
|
-
holdings: Holding[];
|
|
51
|
-
constructor(vaultState: PublicKey, vaultPda: PublicKey, priceBaseAssetMint: PublicKey, slot: number, timestamp: number, commitment: Commitment);
|
|
52
|
-
add(holding: Holding): void;
|
|
53
|
-
toJson(): string;
|
|
54
|
-
}
|
|
55
|
-
export declare class PriceClient {
|
|
56
|
-
readonly base: BaseClient;
|
|
57
|
-
readonly klend: KaminoLendingClient;
|
|
58
|
-
readonly kvaults: KaminoVaultsClient;
|
|
59
|
-
readonly bridge: BridgeClient;
|
|
60
|
-
private readonly getJupiterApi;
|
|
61
|
-
private _stateModel;
|
|
62
|
-
private _lookupTables;
|
|
63
|
-
private _kaminoVaults;
|
|
64
|
-
private _priceVaultIxsQueue;
|
|
65
|
-
constructor(base: BaseClient, klend: KaminoLendingClient, kvaults: KaminoVaultsClient, bridge: BridgeClient, getJupiterApi: () => JupiterApiClient);
|
|
66
|
-
get jupiterApi(): JupiterApiClient;
|
|
67
|
-
get cachedStateModel(): StateModel | null;
|
|
68
|
-
set cachedStateModel(stateModel: StateModel);
|
|
69
|
-
get lookupTables(): PublicKey[];
|
|
70
|
-
get kaminoVaults(): PublicKey[];
|
|
71
|
-
/**
|
|
72
|
-
* Fetches all holdings in the vault.
|
|
73
|
-
*
|
|
74
|
-
* The source of truth for external positions is the `externalPositions` array
|
|
75
|
-
* from the state account, which tracks:
|
|
76
|
-
* - Kamino obligation accounts (lending positions)
|
|
77
|
-
* - Kamino vault share ATAs (shares in kamino vaults)
|
|
78
|
-
*
|
|
79
|
-
* @param commitment Commitment level for fetching accounts
|
|
80
|
-
* @param priceBaseAssetMint Price reference/numeraire asset mint (default: PublicKey.default for USD).
|
|
81
|
-
* Pass a token mint (e.g., WSOL) to get prices denominated in that asset.
|
|
82
|
-
* @returns VaultHoldings object containing all holdings
|
|
83
|
-
*/
|
|
84
|
-
getVaultHoldings(commitment: Commitment, priceBaseAssetMint?: PublicKey): Promise<VaultHoldings>;
|
|
85
|
-
getPubkeysForTokenHoldings(externalPositionsSet: PkSet, commitment?: Commitment): Promise<PublicKey[]>;
|
|
86
|
-
/**
|
|
87
|
-
* Gets kamino obligation reserves from known obligation pubkeys.
|
|
88
|
-
*/
|
|
89
|
-
getPubkeysForKaminoHoldings(obligationPubkeys: PublicKey[], commitment?: Commitment): Promise<PkMap<PkSet>>;
|
|
90
|
-
/**
|
|
91
|
-
* Gets kamino vault states from known share ATA pubkeys.
|
|
92
|
-
* Used by getVaultHoldingsV2 to process vault shares from externalPositions.
|
|
93
|
-
*/
|
|
94
|
-
getKaminoVaultStatesFromAtas(shareAtaPubkeys: PublicKey[], commitment?: Commitment): Promise<PkMap<KVaultState>>;
|
|
95
|
-
/**
|
|
96
|
-
* Fetches token price from the prefetched map, falling back to Jupiter API if not found.
|
|
97
|
-
* @throws Error if price cannot be fetched from either source
|
|
98
|
-
*/
|
|
99
|
-
private getTokenPrice;
|
|
100
|
-
getTokenHoldings(tokenAccountPubkeys: PublicKey[], accountsDataMap: PkMap<Buffer>, tokenPricesMap: PkMap<TokenListItem>, priceSource: string): Promise<Holding[]>;
|
|
101
|
-
getKaminoLendHoldings(obligationPubkeys: Iterable<PublicKey>, reservesMap: PkMap<Reserve>, accountsDataMap: PkMap<Buffer>, tokenPricesMap: PkMap<TokenListItem>, priceSource: string): Promise<Holding[]>;
|
|
102
|
-
getKaminoVaultsHoldings(kvaultAtasAndStates: PkMap<KVaultState>, reservesMap: PkMap<Reserve>, accountsDataMap: PkMap<Buffer>, tokenPricesMap: PkMap<TokenListItem>, priceSource: string): Promise<Holding[]>;
|
|
103
|
-
/**
|
|
104
|
-
* Returns an instruction that prices Kamino obligations.
|
|
105
|
-
* If there are no Kamino obligations, returns null.
|
|
106
|
-
*/
|
|
107
|
-
priceKaminoObligationsIxs(): Promise<TransactionInstruction[]>;
|
|
108
|
-
priceKaminoVaultSharesIx(): Promise<TransactionInstruction[] | null>;
|
|
109
|
-
/**
|
|
110
|
-
* Returns an instruction that prices vault balance and tokens
|
|
111
|
-
*/
|
|
112
|
-
priceVaultTokensIx(): Promise<TransactionInstruction[]>;
|
|
113
|
-
/**
|
|
114
|
-
* Returns an instruction that prices stake accounts.
|
|
115
|
-
* If there are no stake accounts, returns null.
|
|
116
|
-
*/
|
|
117
|
-
priceStakeAccountsIx(): Promise<TransactionInstruction | null>;
|
|
118
|
-
priceVaultIxs(): Promise<TransactionInstruction[]>;
|
|
119
|
-
private enqueuePriceVaultIxs;
|
|
120
|
-
private priceEpiValidatedPositionsIx;
|
|
121
|
-
private _priceVaultIxsImpl;
|
|
122
|
-
validateAumIx(): Promise<TransactionInstruction>;
|
|
123
|
-
getBaseAssetOracle(): Promise<PublicKey>;
|
|
124
|
-
remainingAccountsForPricingVaultAssets(): Promise<[
|
|
125
|
-
AccountMeta[],
|
|
126
|
-
PublicKey[]
|
|
127
|
-
]>;
|
|
128
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, VersionedTransaction, TransactionSignature, TransactionInstruction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
|
|
4
|
-
import { MarinadeClient } from "./marinade";
|
|
5
|
-
import { StakeClient } from "./stake";
|
|
6
|
-
interface StakePoolAccountData {
|
|
7
|
-
programId: PublicKey;
|
|
8
|
-
depositAuthority: PublicKey;
|
|
9
|
-
withdrawAuthority: PublicKey;
|
|
10
|
-
poolMint: PublicKey;
|
|
11
|
-
feeAccount: PublicKey;
|
|
12
|
-
reserveStake: PublicKey;
|
|
13
|
-
tokenProgramId: PublicKey;
|
|
14
|
-
validatorList: PublicKey;
|
|
15
|
-
}
|
|
16
|
-
declare class TxBuilder extends BaseTxBuilder<StakePoolClient> {
|
|
17
|
-
depositSolIxs(stakePool: PublicKey, lamports: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
18
|
-
depositSolTx(stakePool: PublicKey, lamports: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
19
|
-
depositStakeIxs(stakePool: PublicKey, stakeAccount: PublicKey, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
20
|
-
depositStakeTx(stakePool: PublicKey, stakeAccount: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
21
|
-
withdrawStakeIxs(stakePool: PublicKey, amount: BN, deactivate: boolean | undefined, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey]>;
|
|
22
|
-
withdrawStakeTx(stakePool: PublicKey, amount: BN, deactivate?: boolean, txOptions?: TxOptions): Promise<[VersionedTransaction, PublicKey]>;
|
|
23
|
-
}
|
|
24
|
-
export declare class StakePoolClient {
|
|
25
|
-
readonly base: BaseClient;
|
|
26
|
-
readonly stake: StakeClient;
|
|
27
|
-
readonly marinade: MarinadeClient;
|
|
28
|
-
readonly txBuilder: TxBuilder;
|
|
29
|
-
constructor(base: BaseClient, stake: StakeClient, marinade: MarinadeClient);
|
|
30
|
-
unstake(asset: PublicKey, amount: number | BN, deactivate?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
31
|
-
depositSol(stakePool: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
32
|
-
depositStake(stakePool: PublicKey, stakeAccount: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
33
|
-
withdrawStake(stakePool: PublicKey, amount: BN, deactivate?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
34
|
-
getStakePoolWithdrawAuthority(programId: PublicKey, stakePool: PublicKey): PublicKey;
|
|
35
|
-
getStakePoolDepositAuthority(programId: PublicKey, stakePool: PublicKey): PublicKey;
|
|
36
|
-
getStakeAccountVoter(stakeAccount: PublicKey): Promise<PublicKey | null>;
|
|
37
|
-
getStakePoolAccountData(stakePool: PublicKey): Promise<StakePoolAccountData>;
|
|
38
|
-
}
|
|
39
|
-
export {};
|