@glamsystems/glam-sdk 1.1.0 → 1.1.1-alpha.0
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.d.ts +0 -1
- package/index.cjs.js +120789 -1
- package/index.esm.d.ts +0 -1
- package/index.esm.js +120308 -1
- package/package.json +15 -27
- package/target/idl/glam_mint-staging.json +480 -1
- package/target/idl/glam_mint.json +247 -1
- package/target/types/glam_mint-staging.ts +480 -1
- package/target/types/glam_mint.ts +247 -1
- package/LICENSE +0 -201
- package/buffer-layout.d.ts +0 -88
- package/src/assets.d.ts +0 -39
- package/src/client/access.d.ts +0 -57
- package/src/client/base.d.ts +0 -234
- package/src/client/bridge.d.ts +0 -205
- package/src/client/bridgeRegistry.d.ts +0 -32
- package/src/client/cctp.d.ts +0 -164
- package/src/client/epi.d.ts +0 -228
- package/src/client/fees.d.ts +0 -33
- package/src/client/invest.d.ts +0 -37
- package/src/client/jupiter-lend/borrow.d.ts +0 -92
- package/src/client/jupiter-lend/earn.d.ts +0 -64
- package/src/client/jupiter-lend/index.d.ts +0 -3
- package/src/client/jupiter-lend/shared.d.ts +0 -129
- package/src/client/jupiter.d.ts +0 -53
- 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 -94
- package/src/client/kamino/types.d.ts +0 -56
- package/src/client/kamino/vaults.d.ts +0 -39
- package/src/client/loopscale/borrow.d.ts +0 -118
- package/src/client/loopscale/core.d.ts +0 -604
- package/src/client/loopscale/index.d.ts +0 -5
- package/src/client/loopscale/lend.d.ts +0 -123
- package/src/client/loopscale/vault.d.ts +0 -43
- package/src/client/marinade.d.ts +0 -42
- package/src/client/mint.d.ts +0 -143
- package/src/client/orca.d.ts +0 -255
- package/src/client/phoenix.d.ts +0 -214
- package/src/client/price.d.ts +0 -182
- 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 -98
- package/src/client.d.ts +0 -82
- package/src/clientConfig.d.ts +0 -32
- package/src/constants.d.ts +0 -111
- package/src/deser/base.d.ts +0 -18
- package/src/deser/index.d.ts +0 -4
- package/src/deser/integrationPolicies.d.ts +0 -195
- package/src/deser/kaminoLayouts.d.ts +0 -264
- package/src/deser/loopscaleLayouts.d.ts +0 -157
- package/src/deser/tokenAclLayouts.d.ts +0 -67
- package/src/error.d.ts +0 -29
- package/src/glamExports.d.ts +0 -6260
- package/src/globalConfig.d.ts +0 -27
- package/src/index.d.ts +0 -24
- package/src/models/acl.d.ts +0 -43
- package/src/models/index.d.ts +0 -8
- package/src/models/mint.d.ts +0 -57
- package/src/models/state.d.ts +0 -94
- package/src/models/types.d.ts +0 -28
- package/src/protocols.d.ts +0 -29
- package/src/utils/accounts.d.ts +0 -71
- package/src/utils/bitmask.d.ts +0 -53
- package/src/utils/blockhash.d.ts +0 -11
- package/src/utils/common.d.ts +0 -73
- 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 -15
- package/src/utils/helius.d.ts +0 -66
- package/src/utils/index.d.ts +0 -17
- package/src/utils/jupiterApi.d.ts +0 -95
- package/src/utils/lookupTables.d.ts +0 -83
- package/src/utils/phoenixApi.d.ts +0 -146
- package/src/utils/pkmap.d.ts +0 -87
- package/src/utils/pkset.d.ts +0 -73
- package/src/utils/positionCategorizer.d.ts +0 -38
- package/src/utils/rpc.d.ts +0 -18
- package/src/utils/timelock.d.ts +0 -52
- package/src/utils/transaction.d.ts +0 -13
- package/target/idl/ext_bridge-staging.json +0 -2379
- package/target/idl/ext_bridge.json +0 -2379
- package/target/idl/ext_drift.json +0 -5464
- package/target/idl/ext_epi-staging.json +0 -2862
- package/target/idl/ext_epi.json +0 -2862
- package/target/idl/ext_loopscale-staging.json +0 -4708
- package/target/idl/ext_loopscale.json +0 -4708
- package/target/idl/ext_marinade-staging.json +0 -1587
- package/target/idl/ext_phoenix-staging.json +0 -3525
- package/target/idl/ext_phoenix.json +0 -3525
- package/target/idl/mock_layerzero_endpoint.json +0 -144
- package/target/idl/mock_layerzero_oft.json +0 -155
- package/target/idl/mock_wormhole_verify_vaa_shim.json +0 -58
- package/target/types/ext_bridge-staging.d.ts +0 -2385
- package/target/types/ext_bridge-staging.ts +0 -2385
- package/target/types/ext_bridge.d.ts +0 -2385
- package/target/types/ext_bridge.ts +0 -2385
- package/target/types/ext_cctp-staging.d.ts +0 -1268
- package/target/types/ext_cctp.d.ts +0 -1268
- package/target/types/ext_drift.d.ts +0 -5470
- package/target/types/ext_drift.ts +0 -5470
- package/target/types/ext_epi-staging.d.ts +0 -2868
- package/target/types/ext_epi-staging.ts +0 -2868
- package/target/types/ext_epi.d.ts +0 -2868
- package/target/types/ext_epi.ts +0 -2868
- package/target/types/ext_jupiter-staging.d.ts +0 -1966
- package/target/types/ext_jupiter.d.ts +0 -1966
- package/target/types/ext_kamino-staging.d.ts +0 -3433
- package/target/types/ext_kamino.d.ts +0 -3433
- package/target/types/ext_loopscale-staging.d.ts +0 -4714
- package/target/types/ext_loopscale-staging.ts +0 -4714
- package/target/types/ext_loopscale.d.ts +0 -4714
- package/target/types/ext_loopscale.ts +0 -4714
- package/target/types/ext_marinade-staging.d.ts +0 -1593
- package/target/types/ext_marinade-staging.ts +0 -1593
- package/target/types/ext_marinade.d.ts +0 -1593
- package/target/types/ext_orca-staging.d.ts +0 -2829
- package/target/types/ext_orca.d.ts +0 -2829
- package/target/types/ext_phoenix-staging.d.ts +0 -3531
- package/target/types/ext_phoenix-staging.ts +0 -3531
- package/target/types/ext_phoenix.d.ts +0 -3531
- package/target/types/ext_phoenix.ts +0 -3531
- package/target/types/ext_spl-staging.d.ts +0 -1274
- package/target/types/ext_spl.d.ts +0 -1274
- package/target/types/ext_stake_pool-staging.d.ts +0 -1622
- package/target/types/ext_stake_pool.d.ts +0 -1622
- package/target/types/glam_config.d.ts +0 -755
- package/target/types/glam_mint-staging.d.ts +0 -8802
- package/target/types/glam_mint.d.ts +0 -6349
- package/target/types/glam_policies.d.ts +0 -477
- package/target/types/glam_protocol-staging.d.ts +0 -3362
- package/target/types/glam_protocol.d.ts +0 -2783
- package/target/types/mock_layerzero_endpoint.d.ts +0 -150
- package/target/types/mock_layerzero_endpoint.ts +0 -150
- package/target/types/mock_layerzero_oft.d.ts +0 -161
- package/target/types/mock_layerzero_oft.ts +0 -161
- package/target/types/mock_wormhole_verify_vaa_shim.d.ts +0 -64
- package/target/types/mock_wormhole_verify_vaa_shim.ts +0 -64
|
@@ -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,94 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, VersionedTransaction, TransactionSignature, TransactionInstruction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, type ProtocolPolicyClient, type ProtocolPolicyTxBuilder, type TxOptions } from "../base";
|
|
4
|
-
import { KaminoLendingPolicy } from "../../deser/integrationPolicies";
|
|
5
|
-
import { Reserve, Obligation } from "../../deser/kaminoLayouts";
|
|
6
|
-
import { VaultClient } from "../vault";
|
|
7
|
-
import { RefreshObligationAccounts, RefreshReserveAccounts, RefreshObligationFarmsForReserveArgs, RefreshObligationFarmsForReserveAccounts } from "./types";
|
|
8
|
-
declare class TxBuilder extends BaseTxBuilder<KaminoLendingClient> implements ProtocolPolicyTxBuilder<KaminoLendingPolicy> {
|
|
9
|
-
refreshObligationIx(accounts: RefreshObligationAccounts): TransactionInstruction;
|
|
10
|
-
refreshReserveIx(accounts: RefreshReserveAccounts): TransactionInstruction;
|
|
11
|
-
refreshObligationFarmsForReserveIx(args: RefreshObligationFarmsForReserveArgs, accounts: RefreshObligationFarmsForReserveAccounts): TransactionInstruction;
|
|
12
|
-
refreshReservesBatchIx(reserves: Reserve[], skipPriceUpdates: boolean): TransactionInstruction;
|
|
13
|
-
refreshReservesIxs(reserves: Reserve[]): TransactionInstruction[];
|
|
14
|
-
refreshObligationCollateralFarmsForReservesIxs(obligation: PublicKey, reserves: Reserve[]): TransactionInstruction[];
|
|
15
|
-
refreshObligationDebtFarmsForReservesIxs(obligation: PublicKey, reserves: Reserve[]): TransactionInstruction[];
|
|
16
|
-
/**
|
|
17
|
-
* Returns two instructions that refresh reserves in batch and refresh obligation
|
|
18
|
-
*/
|
|
19
|
-
refreshReservesAndObligationIxs(obligation: PublicKey, targetReserve: Reserve): Promise<TransactionInstruction[]>;
|
|
20
|
-
/**
|
|
21
|
-
* Returns an instruction to initialize obligation farm user if it doesn't exist
|
|
22
|
-
*
|
|
23
|
-
* @param mode 0 collateral farm, 1 debt farm
|
|
24
|
-
*/
|
|
25
|
-
initObligationFarmUserForReserveIx(obligation: PublicKey, reserve: Reserve, mode: 0 | 1, signer?: PublicKey): Promise<{
|
|
26
|
-
farmUser: null;
|
|
27
|
-
initIx: null;
|
|
28
|
-
} | {
|
|
29
|
-
farmUser: PublicKey;
|
|
30
|
-
initIx: TransactionInstruction | null;
|
|
31
|
-
}>;
|
|
32
|
-
initUserMetadataTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
33
|
-
depositIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
34
|
-
depositTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
35
|
-
withdrawIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
36
|
-
withdrawTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
37
|
-
borrowIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
38
|
-
borrowTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
39
|
-
requestElevationGroupIxs(lendingMarket: PublicKey, elevationGroup: number, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
40
|
-
requestElevationGroupTx(lendingMarket: PublicKey, elevationGroup: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
41
|
-
repayIxs(market: PublicKey, asset: PublicKey, amount: BN, glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
42
|
-
repayTx(market: PublicKey, asset: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
43
|
-
setPolicyIx(policy: KaminoLendingPolicy, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
44
|
-
setPolicyTx(policy: KaminoLendingPolicy, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
45
|
-
clearPolicyIx(signer?: PublicKey): Promise<TransactionInstruction>;
|
|
46
|
-
clearPolicyTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
47
|
-
}
|
|
48
|
-
export declare class KaminoLendingClient implements ProtocolPolicyClient<KaminoLendingPolicy> {
|
|
49
|
-
readonly base: BaseClient;
|
|
50
|
-
readonly vault: VaultClient;
|
|
51
|
-
private reserves;
|
|
52
|
-
private obligations;
|
|
53
|
-
txBuilder: TxBuilder;
|
|
54
|
-
constructor(base: BaseClient, vault: VaultClient);
|
|
55
|
-
/**
|
|
56
|
-
* Initializes Kamino user metadata
|
|
57
|
-
*/
|
|
58
|
-
initUserMetadata(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
59
|
-
/**
|
|
60
|
-
* Deposits asset to the lending market.
|
|
61
|
-
*/
|
|
62
|
-
deposit(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
63
|
-
/**
|
|
64
|
-
* Withdraws asset from the lending market.
|
|
65
|
-
*/
|
|
66
|
-
withdraw(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
67
|
-
/**
|
|
68
|
-
* Borrows asset from the lending market.
|
|
69
|
-
*/
|
|
70
|
-
borrow(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
71
|
-
/**
|
|
72
|
-
* Requests an elevation group for an obligation.
|
|
73
|
-
*/
|
|
74
|
-
requestElevationGroup(market: PublicKey | string, elevationGroup: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
75
|
-
/**
|
|
76
|
-
* Repays asset to the lending market.
|
|
77
|
-
*/
|
|
78
|
-
repay(market: PublicKey | string, asset: PublicKey | string, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
79
|
-
fetchPolicy(): Promise<KaminoLendingPolicy | null>;
|
|
80
|
-
setPolicy(policy: KaminoLendingPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
81
|
-
clearPolicy(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
82
|
-
getUserMetadataPda(owner: PublicKey): PublicKey;
|
|
83
|
-
getObligationPda(owner: PublicKey, market: PublicKey, args?: {
|
|
84
|
-
tag: number;
|
|
85
|
-
id: number;
|
|
86
|
-
}): PublicKey;
|
|
87
|
-
getFarmUserState(farmUser: PublicKey, farm: PublicKey): PublicKey;
|
|
88
|
-
getMarketAuthority(market: PublicKey): PublicKey;
|
|
89
|
-
fetchAndParseObligation(obligation: PublicKey): Promise<Obligation>;
|
|
90
|
-
fetchAndParseReserves(reserves: PublicKey[]): Promise<Reserve[]>;
|
|
91
|
-
findAndParseReserve(market: PublicKey, asset: PublicKey): Promise<Reserve>;
|
|
92
|
-
findAndParseObligations(owner: PublicKey, market?: PublicKey): Promise<Obligation[]>;
|
|
93
|
-
}
|
|
94
|
-
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,39 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, TransactionInstruction, VersionedTransaction, TransactionSignature, AccountMeta, Commitment } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, type ProtocolPolicyClient, type ProtocolPolicyTxBuilder, type TxOptions } from "../base";
|
|
4
|
-
import { KVaultAllocation, KVaultState } from "../../deser/kaminoLayouts";
|
|
5
|
-
import { KaminoVaultsPolicy } from "../../deser/integrationPolicies";
|
|
6
|
-
import { KaminoLendingClient } from "./lending";
|
|
7
|
-
declare class TxBuilder extends BaseTxBuilder<KaminoVaultsClient> implements ProtocolPolicyTxBuilder<KaminoVaultsPolicy> {
|
|
8
|
-
depositTx(vault: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
9
|
-
withdrawTx(vault: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
10
|
-
setPolicyIx(policy: KaminoVaultsPolicy, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
11
|
-
setPolicyTx(policy: KaminoVaultsPolicy, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
12
|
-
clearPolicyIx(signer?: PublicKey): Promise<TransactionInstruction>;
|
|
13
|
-
clearPolicyTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
14
|
-
}
|
|
15
|
-
export declare class KaminoVaultsClient implements ProtocolPolicyClient<KaminoVaultsPolicy> {
|
|
16
|
-
readonly base: BaseClient;
|
|
17
|
-
readonly kaminoLending: KaminoLendingClient;
|
|
18
|
-
private vaultStates;
|
|
19
|
-
private shareMintToVaultPdaMap;
|
|
20
|
-
txBuilder: TxBuilder;
|
|
21
|
-
constructor(base: BaseClient, kaminoLending: KaminoLendingClient);
|
|
22
|
-
/**
|
|
23
|
-
* Deposit to a Kamino vault
|
|
24
|
-
*/
|
|
25
|
-
deposit(vault: PublicKey, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
26
|
-
/**
|
|
27
|
-
* Withdraw from a Kamino vault
|
|
28
|
-
*/
|
|
29
|
-
withdraw(vault: PublicKey, amount: BN | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
30
|
-
fetchPolicy(): Promise<KaminoVaultsPolicy | null>;
|
|
31
|
-
setPolicy(policy: KaminoVaultsPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
32
|
-
clearPolicy(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
33
|
-
findAndParseKaminoVaults(commitment?: Commitment): Promise<KVaultState[]>;
|
|
34
|
-
get globalConfigPda(): PublicKey;
|
|
35
|
-
getVaultPdasByShareMints(mints: PublicKey[]): Promise<PublicKey[]>;
|
|
36
|
-
fetchAndParseVaultState(vault: PublicKey): Promise<KVaultState>;
|
|
37
|
-
composeRemainingAccounts(allocations: KVaultAllocation[], pricingMode?: boolean): Promise<AccountMeta[]>;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { Commitment, PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, type ProtocolPolicyClient, type TxOptions } from "../base";
|
|
4
|
-
import { LoopscaleBorrowPolicy } from "../../deser/integrationPolicies";
|
|
5
|
-
import { LoopscaleLoan, LoopscaleMarketInformation, LoopscaleStrategy } from "../../deser";
|
|
6
|
-
import { BorrowMarketAccounts, BorrowPrincipalAccounts, BorrowPrincipalParams, CreateLoanParams, DepositCollateralAccounts, DepositCollateralParams, LoopscaleBorrowPrincipalTerms, LoopscaleBorrowQuoteTerms, LoopscaleBorrowTxBuilder, LoopscaleCoreClient, LoopscaleMaxQuoteParams, LoopscaleQuote, PriceLoansAccounts, RepayPrincipalAccounts, RepayPrincipalParams, UpdateWeightMatrixAccounts, UpdateWeightMatrixParams, WithdrawCollateralAccounts, WithdrawCollateralParams } from "./core";
|
|
7
|
-
export type Tuple5 = [number, number, number, number, number];
|
|
8
|
-
export declare class LoopscaleBorrowClient implements ProtocolPolicyClient<LoopscaleBorrowPolicy> {
|
|
9
|
-
private readonly core;
|
|
10
|
-
readonly txBuilder: LoopscaleBorrowTxBuilder;
|
|
11
|
-
constructor(core: LoopscaleCoreClient);
|
|
12
|
-
get base(): BaseClient;
|
|
13
|
-
get programId(): PublicKey;
|
|
14
|
-
get integrationAuthorityPda(): PublicKey;
|
|
15
|
-
getEventAuthorityPda(): PublicKey;
|
|
16
|
-
getLoanPda: (nonce: BN, borrower?: PublicKey) => PublicKey;
|
|
17
|
-
getLoanTokenAta(loan: PublicKey, mint: PublicKey, tokenProgram?: PublicKey): PublicKey;
|
|
18
|
-
fetchPolicy(): Promise<LoopscaleBorrowPolicy | null>;
|
|
19
|
-
setPolicy(policy: LoopscaleBorrowPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
20
|
-
clearPolicy(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
21
|
-
fetchLoan(loan: PublicKey): Promise<LoopscaleLoan>;
|
|
22
|
-
fetchOwnedLoan(loan: PublicKey, borrower?: PublicKey): Promise<LoopscaleLoan>;
|
|
23
|
-
fetchRegisteredLoans(commitment?: Commitment): Promise<LoopscaleLoan[]>;
|
|
24
|
-
fetchMarketInformation(marketInformation: PublicKey): Promise<LoopscaleMarketInformation>;
|
|
25
|
-
fetchStrategy(strategy: PublicKey): Promise<LoopscaleStrategy>;
|
|
26
|
-
fetchMaxQuotes(params: LoopscaleMaxQuoteParams): Promise<LoopscaleQuote[]>;
|
|
27
|
-
selectBestQuote(quotes: LoopscaleQuote[], externalYieldSource?: number, borrowAmount?: BN): Promise<LoopscaleQuote>;
|
|
28
|
-
fetchBestQuote(params: LoopscaleMaxQuoteParams): Promise<LoopscaleQuote>;
|
|
29
|
-
resolveBorrowMarketAccounts(params: {
|
|
30
|
-
strategy: PublicKey | LoopscaleStrategy;
|
|
31
|
-
collateralMint: PublicKey;
|
|
32
|
-
expectedApy: BN;
|
|
33
|
-
}): Promise<BorrowMarketAccounts>;
|
|
34
|
-
resolveBorrowTermsFromStrategy(params: {
|
|
35
|
-
strategy: PublicKey | LoopscaleStrategy;
|
|
36
|
-
principalMint: PublicKey;
|
|
37
|
-
assetIdentifier: PublicKey;
|
|
38
|
-
expectedApy: BN;
|
|
39
|
-
expectedLqt: Tuple5;
|
|
40
|
-
}): Promise<LoopscaleBorrowPrincipalTerms>;
|
|
41
|
-
resolveBorrowTermsFromTargetStrategy(params: {
|
|
42
|
-
strategy: PublicKey | LoopscaleStrategy;
|
|
43
|
-
principalMint: PublicKey;
|
|
44
|
-
assetIdentifier: PublicKey;
|
|
45
|
-
requestedDurationIndex?: number;
|
|
46
|
-
}): Promise<LoopscaleBorrowPrincipalTerms>;
|
|
47
|
-
resolveBorrowTermsFromQuote(params: {
|
|
48
|
-
principalMint: PublicKey;
|
|
49
|
-
collateralMint: PublicKey;
|
|
50
|
-
assetIdentifier: PublicKey;
|
|
51
|
-
collateralAmount: BN;
|
|
52
|
-
borrowAmount: BN;
|
|
53
|
-
durationType: number;
|
|
54
|
-
duration: number;
|
|
55
|
-
externalYieldSource?: number;
|
|
56
|
-
}): Promise<LoopscaleBorrowQuoteTerms>;
|
|
57
|
-
buildApiCreateLoanIxs(params: CreateLoanParams): Promise<{
|
|
58
|
-
loan: PublicKey;
|
|
59
|
-
ixs: TransactionInstruction[];
|
|
60
|
-
}>;
|
|
61
|
-
buildApiDepositCollateralIxs(params: {
|
|
62
|
-
loan: PublicKey;
|
|
63
|
-
depositMint: PublicKey;
|
|
64
|
-
amount: BN;
|
|
65
|
-
assetType: number;
|
|
66
|
-
assetIdentifier: PublicKey;
|
|
67
|
-
assetIndexGuidance: number[];
|
|
68
|
-
}): Promise<TransactionInstruction[]>;
|
|
69
|
-
buildApiBorrowPrincipalIxs(params: {
|
|
70
|
-
loan: PublicKey;
|
|
71
|
-
strategy: PublicKey;
|
|
72
|
-
amount: BN;
|
|
73
|
-
assetIndexGuidance: number[];
|
|
74
|
-
duration: number;
|
|
75
|
-
expectedLoanValues: {
|
|
76
|
-
expectedApy: BN;
|
|
77
|
-
expectedLqt: Tuple5;
|
|
78
|
-
};
|
|
79
|
-
skipSolUnwrap: boolean;
|
|
80
|
-
}): Promise<TransactionInstruction[]>;
|
|
81
|
-
buildApiWithdrawCollateralIxs(params: {
|
|
82
|
-
loan: PublicKey;
|
|
83
|
-
collateralMint: PublicKey;
|
|
84
|
-
amount: BN;
|
|
85
|
-
collateralIndex: number;
|
|
86
|
-
assetIndexGuidance: number[];
|
|
87
|
-
expectedLoanValues: {
|
|
88
|
-
expectedApy: BN;
|
|
89
|
-
expectedLqt: Tuple5;
|
|
90
|
-
};
|
|
91
|
-
}): Promise<TransactionInstruction[]>;
|
|
92
|
-
buildApiRepayPrincipalIxs(params: {
|
|
93
|
-
loan: PublicKey;
|
|
94
|
-
strategy: PublicKey;
|
|
95
|
-
amount: BN;
|
|
96
|
-
ledgerIndex: number;
|
|
97
|
-
repayAll: boolean;
|
|
98
|
-
}): Promise<TransactionInstruction[]>;
|
|
99
|
-
cosignTransaction(params: {
|
|
100
|
-
tx: VersionedTransaction;
|
|
101
|
-
identifier: string;
|
|
102
|
-
}): Promise<VersionedTransaction>;
|
|
103
|
-
createLoan(params: CreateLoanParams, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
104
|
-
closeLoan(loan: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
105
|
-
depositCollateral(params: DepositCollateralParams, accounts: DepositCollateralAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
106
|
-
/** @deprecated */
|
|
107
|
-
updateWeightMatrix(params: UpdateWeightMatrixParams, accounts: UpdateWeightMatrixAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
108
|
-
borrowPrincipal(params: BorrowPrincipalParams, accounts: BorrowPrincipalAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
109
|
-
withdrawCollateral(params: WithdrawCollateralParams, accounts: WithdrawCollateralAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
110
|
-
repayPrincipal(params: RepayPrincipalParams, accounts: RepayPrincipalAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
111
|
-
/** @deprecated */
|
|
112
|
-
resolveLedgerStrategyAccounts(strategy: PublicKey): Promise<{
|
|
113
|
-
strategy: PublicKey;
|
|
114
|
-
marketInformation: PublicKey;
|
|
115
|
-
principalMint: PublicKey;
|
|
116
|
-
}>;
|
|
117
|
-
getPriceLoansAccounts(commitment?: Commitment): Promise<PriceLoansAccounts | null>;
|
|
118
|
-
}
|