@glamsystems/glam-sdk 1.1.0-alpha.0 → 1.1.0-alpha.2

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.
Files changed (85) hide show
  1. package/index.cjs.js +4898 -1183
  2. package/index.esm.js +4890 -1172
  3. package/package.json +2 -2
  4. package/target/idl/glam_mint-staging.json +236 -0
  5. package/target/idl/glam_protocol-staging.json +5 -0
  6. package/target/idl/glam_protocol.json +5 -0
  7. package/target/types/glam_mint-staging.ts +236 -0
  8. package/target/types/glam_protocol-staging.ts +5 -0
  9. package/target/types/glam_protocol.ts +5 -0
  10. package/src/assets.d.ts +0 -39
  11. package/src/client/access.d.ts +0 -57
  12. package/src/client/base.d.ts +0 -184
  13. package/src/client/bridge.d.ts +0 -183
  14. package/src/client/bridgeRegistry.d.ts +0 -32
  15. package/src/client/cctp.d.ts +0 -156
  16. package/src/client/epi.d.ts +0 -78
  17. package/src/client/fees.d.ts +0 -33
  18. package/src/client/invest.d.ts +0 -37
  19. package/src/client/jupiter.d.ts +0 -45
  20. package/src/client/kamino/farm.d.ts +0 -39
  21. package/src/client/kamino/index.d.ts +0 -4
  22. package/src/client/kamino/lending.d.ts +0 -86
  23. package/src/client/kamino/types.d.ts +0 -56
  24. package/src/client/kamino/vaults.d.ts +0 -31
  25. package/src/client/loopscale.d.ts +0 -84
  26. package/src/client/marinade.d.ts +0 -42
  27. package/src/client/mint.d.ts +0 -127
  28. package/src/client/neutral.d.ts +0 -111
  29. package/src/client/price.d.ts +0 -137
  30. package/src/client/stake-pool.d.ts +0 -39
  31. package/src/client/stake.d.ts +0 -34
  32. package/src/client/state.d.ts +0 -56
  33. package/src/client/timelock.d.ts +0 -31
  34. package/src/client/vault.d.ts +0 -90
  35. package/src/client.d.ts +0 -68
  36. package/src/clientConfig.d.ts +0 -29
  37. package/src/constants.d.ts +0 -84
  38. package/src/deser/base.d.ts +0 -18
  39. package/src/deser/index.d.ts +0 -3
  40. package/src/deser/integrationPolicies.d.ts +0 -120
  41. package/src/deser/kaminoLayouts.d.ts +0 -264
  42. package/src/deser/tokenAclLayouts.d.ts +0 -67
  43. package/src/error.d.ts +0 -29
  44. package/src/glamExports.d.ts +0 -5116
  45. package/src/globalConfig.d.ts +0 -27
  46. package/src/index.d.ts +0 -20
  47. package/src/models/acl.d.ts +0 -43
  48. package/src/models/index.d.ts +0 -8
  49. package/src/models/mint.d.ts +0 -64
  50. package/src/models/state.d.ts +0 -104
  51. package/src/models/types.d.ts +0 -28
  52. package/src/react/cluster-provider.d.ts +0 -22
  53. package/src/react/glam.d.ts +0 -47
  54. package/src/react/index.d.ts +0 -5
  55. package/src/react/query-keys.d.ts +0 -38
  56. package/src/react/useVaultBalanceSubscription.d.ts +0 -17
  57. package/src/utils/accounts.d.ts +0 -72
  58. package/src/utils/bitmask.d.ts +0 -53
  59. package/src/utils/blockhash.d.ts +0 -11
  60. package/src/utils/common.d.ts +0 -37
  61. package/src/utils/computeBudget.d.ts +0 -15
  62. package/src/utils/evm.d.ts +0 -10
  63. package/src/utils/fraction.d.ts +0 -29
  64. package/src/utils/glamPDAs.d.ts +0 -15
  65. package/src/utils/index.d.ts +0 -16
  66. package/src/utils/jupiterApi.d.ts +0 -89
  67. package/src/utils/lookupTables.d.ts +0 -53
  68. package/src/utils/pkmap.d.ts +0 -87
  69. package/src/utils/pkset.d.ts +0 -73
  70. package/src/utils/positionCategorizer.d.ts +0 -36
  71. package/src/utils/rpc.d.ts +0 -33
  72. package/src/utils/timelock.d.ts +0 -52
  73. package/src/utils/transaction.d.ts +0 -13
  74. package/target/types/ext_bridge.d.ts +0 -2385
  75. package/target/types/ext_cctp.d.ts +0 -1268
  76. package/target/types/ext_epi.d.ts +0 -2175
  77. package/target/types/ext_kamino.d.ts +0 -3433
  78. package/target/types/ext_loopscale.d.ts +0 -3547
  79. package/target/types/ext_marinade.d.ts +0 -1593
  80. package/target/types/ext_neutral.d.ts +0 -1786
  81. package/target/types/ext_spl.d.ts +0 -1274
  82. package/target/types/ext_stake_pool.d.ts +0 -1622
  83. package/target/types/glam_config.d.ts +0 -755
  84. package/target/types/glam_mint.d.ts +0 -6106
  85. package/target/types/glam_protocol.d.ts +0 -2708
@@ -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 {};
@@ -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
- };
22
- declare class TxBuilder extends BaseTxBuilder<JupiterSwapClient> {
23
- private resolveSwapInstructionContext;
24
- getSwapV2OracleAccounts(inputMint: PublicKey, outputMint: PublicKey, skipQuotePriceCheck: boolean): Promise<JupiterSwapV2OracleAccounts>;
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,4 +0,0 @@
1
- export * from "./types";
2
- export * from "./lending";
3
- export * from "./farm";
4
- export * from "./vaults";
@@ -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 {};
@@ -1,84 +0,0 @@
1
- import { BN } from "@coral-xyz/anchor";
2
- import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction, AccountMeta } from "@solana/web3.js";
3
- import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
4
- export declare const LOOPSCALE_BS_AUTH: PublicKey;
5
- export type LoopscaleExpectedLoanValues = {
6
- expectedApy: BN;
7
- expectedLqt: [number, number, number, number, number];
8
- };
9
- export type CreateLoanParams = {
10
- nonce: BN;
11
- };
12
- export type DepositCollateralParams = {
13
- amount: BN;
14
- assetType: number;
15
- assetIdentifier: PublicKey;
16
- assetIndexGuidance: Buffer;
17
- };
18
- export type UpdateWeightMatrixParams = {
19
- collateralIndex: number;
20
- weightMatrix: [number, number, number, number, number];
21
- expectedLoanValues: LoopscaleExpectedLoanValues;
22
- assetIndexGuidance: Buffer;
23
- };
24
- export type BorrowPrincipalParams = {
25
- amount: BN;
26
- assetIndexGuidance: Buffer;
27
- duration: number;
28
- expectedLoanValues: LoopscaleExpectedLoanValues;
29
- skipSolUnwrap: boolean;
30
- };
31
- export type CreateLoanAccounts = {
32
- loan: PublicKey;
33
- };
34
- export type DepositCollateralAccounts = {
35
- loan: PublicKey;
36
- depositMint: PublicKey;
37
- borrowerCollateralTa?: PublicKey;
38
- loanCollateralTa?: PublicKey;
39
- assetIdentifier?: PublicKey;
40
- tokenProgram?: PublicKey;
41
- associatedTokenProgram?: PublicKey;
42
- };
43
- export type UpdateWeightMatrixAccounts = {
44
- loan: PublicKey;
45
- };
46
- export type BorrowPrincipalAccounts = {
47
- loan: PublicKey;
48
- strategy: PublicKey;
49
- marketInformation: PublicKey;
50
- principalMint: PublicKey;
51
- borrowerTa?: PublicKey;
52
- strategyTa?: PublicKey;
53
- tokenProgram?: PublicKey;
54
- associatedTokenProgram?: PublicKey;
55
- remainingAccounts?: AccountMeta[];
56
- };
57
- export declare function getLoopscaleEventAuthorityPda(programId?: PublicKey): PublicKey;
58
- export declare function getLoopscaleLoanPda(borrower: PublicKey, nonce: BN | bigint | number, programId?: PublicKey): PublicKey;
59
- declare class TxBuilder extends BaseTxBuilder<LoopscaleClient> {
60
- createLoanIx(params: CreateLoanParams, accounts: CreateLoanAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
61
- createLoanTx(params: CreateLoanParams, accounts: CreateLoanAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
62
- depositCollateralIx(params: DepositCollateralParams, accounts: DepositCollateralAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
63
- depositCollateralTx(params: DepositCollateralParams, accounts: DepositCollateralAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
64
- updateWeightMatrixIx(params: UpdateWeightMatrixParams, accounts: UpdateWeightMatrixAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
65
- updateWeightMatrixTx(params: UpdateWeightMatrixParams, accounts: UpdateWeightMatrixAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
66
- borrowPrincipalIx(params: BorrowPrincipalParams, accounts: BorrowPrincipalAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
67
- borrowPrincipalTx(params: BorrowPrincipalParams, accounts: BorrowPrincipalAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
68
- }
69
- export declare class LoopscaleClient {
70
- readonly base: BaseClient;
71
- readonly txBuilder: TxBuilder;
72
- constructor(base: BaseClient);
73
- getIntegrationAuthorityPda(): PublicKey;
74
- getEventAuthorityPda(): PublicKey;
75
- getBsAuth(): PublicKey;
76
- getLoanPda(nonce: BN | bigint | number, borrower?: PublicKey): PublicKey;
77
- getLoanTokenAta(loan: PublicKey, mint: PublicKey, tokenProgram?: PublicKey): PublicKey;
78
- getStrategyTokenAta(strategy: PublicKey, mint: PublicKey, tokenProgram?: PublicKey): PublicKey;
79
- createLoan(params: CreateLoanParams, accounts: CreateLoanAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
80
- depositCollateral(params: DepositCollateralParams, accounts: DepositCollateralAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
81
- updateWeightMatrix(params: UpdateWeightMatrixParams, accounts: UpdateWeightMatrixAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
82
- borrowPrincipal(params: BorrowPrincipalParams, accounts: BorrowPrincipalAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
83
- }
84
- export {};
@@ -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 {};
@@ -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 {};