@glamsystems/glam-sdk 1.1.0-alpha.1 → 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 +6583 -2920
  2. package/index.esm.js +6575 -2909
  3. package/package.json +2 -2
  4. package/target/idl/glam_mint-staging.json +18 -15
  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 +18 -15
  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 -109
  29. package/src/client/price.d.ts +0 -138
  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 -1670
  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,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 {};
@@ -1,109 +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 { NeutralPolicy } from "../deser/integrationPolicies";
5
- import { NTBUNDLE_PROGRAM_ID } from "../constants";
6
- export { NTBUNDLE_PROGRAM_ID };
7
- export declare const NEUTRAL_PROTOCOL = 1;
8
- export declare const NEUTRAL_BUNDLE_DISCRIMINATOR: Buffer<ArrayBuffer>;
9
- export type InitializeBundleDepositorAccounts = {
10
- bundle: PublicKey;
11
- userBundleAccount?: PublicKey;
12
- };
13
- export type RequestDepositAccounts = {
14
- bundle: PublicKey;
15
- userTokenAccount?: PublicKey;
16
- pendingDepositTokenAccount?: PublicKey;
17
- treasuryAccount?: PublicKey;
18
- userBundleAccount?: PublicKey;
19
- assetAddress?: PublicKey;
20
- oracleData?: PublicKey;
21
- bundleTempData?: PublicKey;
22
- pendingBundleAssetAuthority?: PublicKey;
23
- tokenProgram?: PublicKey;
24
- };
25
- export type NeutralBundleView = {
26
- treasuryAccount: PublicKey;
27
- assetAddress: PublicKey;
28
- assetDecimals: number;
29
- permissioned: boolean;
30
- };
31
- export declare class NeutralBundleAccount {
32
- readonly _address: PublicKey;
33
- discriminator: number[];
34
- name: number[];
35
- manager: PublicKey;
36
- keeper: PublicKey;
37
- treasuryAccount: PublicKey;
38
- allocatedReceivers: PublicKey[];
39
- bundleUnderlyingBalance: BN;
40
- maxDepositAmount: BN;
41
- withdrawalDelay: BN;
42
- performanceFee: number;
43
- managementFeeBps: number;
44
- depositFee: number;
45
- withdrawalFee: number;
46
- managerPfeeShares: BN;
47
- currentAllocationBps: number;
48
- oracleBuffer: BN;
49
- totalShares: BN;
50
- assetPrecision: BN;
51
- assetAddress: PublicKey;
52
- assetDecimals: number;
53
- withdrawalTMin: BN;
54
- withdrawalTMax: BN;
55
- withdrawalCurve: number;
56
- permissionned: boolean;
57
- managerMfeeShares: BN;
58
- minDepositAmount: BN;
59
- oracleUpdateTimeLimit: BN;
60
- oracleMaxAge: BN;
61
- withdrawalRedemptionRequestCutoffTs: BN;
62
- withdrawalRedemptionUnlockCurrentCycleTs: BN;
63
- withdrawalRedemptionUnlockNextCycleTs: BN;
64
- padding: number[];
65
- static _layout: any;
66
- static decode(address: PublicKey, buffer: Buffer): NeutralBundleAccount;
67
- getAddress(): PublicKey;
68
- get permissioned(): boolean;
69
- toView(): NeutralBundleView;
70
- }
71
- export declare function getNeutralUserBundlePda(authority: PublicKey, bundle: PublicKey): PublicKey;
72
- export declare function getNeutralOracleDataPda(bundle: PublicKey): PublicKey;
73
- export declare function getNeutralBundleTempDataPda(bundle: PublicKey): PublicKey;
74
- export declare function getNeutralPendingBundleAssetAuthorityPda(bundle: PublicKey): PublicKey;
75
- export declare function getNeutralPendingDepositTokenAccountPda(pendingBundleAssetAuthority: PublicKey, assetAddress: PublicKey): PublicKey;
76
- declare class TxBuilder extends BaseTxBuilder<NeutralClient> {
77
- setNeutralPolicyIx(policy: NeutralPolicy, signer?: PublicKey): Promise<TransactionInstruction>;
78
- setNeutralPolicyTx(policy: NeutralPolicy, txOptions?: TxOptions): Promise<VersionedTransaction>;
79
- initializeBundleDepositorIx(accounts: InitializeBundleDepositorAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
80
- initializeBundleDepositorTx(accounts: InitializeBundleDepositorAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
81
- requestDepositIx(accounts: RequestDepositAccounts, amount: BN | bigint | number | string, signer?: PublicKey): Promise<TransactionInstruction>;
82
- requestDepositTx(accounts: RequestDepositAccounts, amount: BN | bigint | number | string, txOptions?: TxOptions): Promise<VersionedTransaction>;
83
- }
84
- export declare class NeutralClient {
85
- readonly base: BaseClient;
86
- readonly txBuilder: TxBuilder;
87
- constructor(base: BaseClient);
88
- baseAccounts(signer?: PublicKey): {
89
- glamState: PublicKey;
90
- glamVault: PublicKey;
91
- glamSigner: PublicKey;
92
- integrationAuthority: PublicKey;
93
- cpiProgram: PublicKey;
94
- glamProtocolProgram: PublicKey;
95
- systemProgram: PublicKey;
96
- };
97
- getIntegrationAuthorityPda(): PublicKey;
98
- getUserBundlePda(bundle: PublicKey): PublicKey;
99
- getOracleDataPda(bundle: PublicKey): PublicKey;
100
- getBundleTempDataPda(bundle: PublicKey): PublicKey;
101
- getPendingBundleAssetAuthorityPda(bundle: PublicKey): PublicKey;
102
- fetchBundle(bundle: PublicKey): Promise<NeutralBundleAccount>;
103
- fetchPolicy(): Promise<NeutralPolicy | null>;
104
- setPolicy(policy: NeutralPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
105
- allowlistBundle(bundle: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
106
- initializeBundleDepositor(bundle: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
107
- requestDeposit(bundle: PublicKey, amount: BN | bigint | number | string, txOptions?: TxOptions): Promise<TransactionSignature>;
108
- requestDepositUiAmount(bundle: PublicKey, amount: number | string, txOptions?: TxOptions): Promise<TransactionSignature>;
109
- }
@@ -1,138 +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
- import { EpiClient } from "./epi";
11
- /**
12
- * Represents a single asset holding within a vault.
13
- *
14
- * @param mintAddress - The SPL token mint address of the held asset
15
- * @param decimals - Number of decimal places for the token (e.g., 6 for USDC, 9 for SOL)
16
- * @param amount - Unsigned token amount in native units; direction (deposit/borrow) is in protocolMeta
17
- * @param price - Current price of the asset denominated in the base asset (e.g., USD, SOL)
18
- * @param priceMeta - Additional pricing context (e.g., source, slot, base asset). Default base asset, if not specified, is USD.
19
- * @param protocol - Protocol identifier where the asset is allocated
20
- * @param protocolMeta - Protocol-specific metadata (e.g., market index, position direction, reserve address)
21
- */
22
- export declare class Holding {
23
- readonly mintAddress: PublicKey;
24
- readonly decimals: number;
25
- readonly amount: BN;
26
- readonly price: number;
27
- readonly priceMeta: Record<string, any>;
28
- readonly protocol: string;
29
- readonly protocolMeta: Record<string, any>;
30
- readonly uiAmount: number;
31
- constructor(mintAddress: PublicKey, decimals: number, amount: BN, price: number, priceMeta: Record<string, any> | undefined, protocol: string, protocolMeta?: Record<string, any>);
32
- }
33
- /**
34
- * Aggregates all holdings for a GLAM vault.
35
- * Includes token balances and supported DeFi positions.
36
- *
37
- * @param vaultState - The vault's state account address (stores vault configuration)
38
- * @param vaultPda - The vault's PDA that holds tokens and positions
39
- * @param priceBaseAssetMint - The base asset mint used for pricing (e.g., PublicKey.default for USD, So11111111111111111111111111111111111111112 for SOL)
40
- * @param slot - The Solana slot at which holdings were fetched
41
- * @param timestamp - Unix timestamp (seconds) when holdings were fetched
42
- * @param commitment - The Solana commitment level used for fetching account data
43
- */
44
- export declare class VaultHoldings {
45
- readonly vaultState: PublicKey;
46
- readonly vaultPda: PublicKey;
47
- readonly priceBaseAssetMint: PublicKey;
48
- readonly slot: number;
49
- readonly timestamp: number;
50
- readonly commitment: Commitment;
51
- holdings: Holding[];
52
- constructor(vaultState: PublicKey, vaultPda: PublicKey, priceBaseAssetMint: PublicKey, slot: number, timestamp: number, commitment: Commitment);
53
- add(holding: Holding): void;
54
- toJson(): string;
55
- }
56
- type PricingChunk = {
57
- ixs: TransactionInstruction[];
58
- kaminoReserves: PublicKey[];
59
- };
60
- export declare class PriceClient {
61
- readonly base: BaseClient;
62
- readonly klend: KaminoLendingClient;
63
- readonly kvaults: KaminoVaultsClient;
64
- readonly bridge: BridgeClient;
65
- readonly epi: EpiClient;
66
- private readonly getJupiterApi;
67
- private _stateModel;
68
- private _lookupTables;
69
- private _kaminoVaults;
70
- private _priceVaultIxsQueue;
71
- constructor(base: BaseClient, klend: KaminoLendingClient, kvaults: KaminoVaultsClient, bridge: BridgeClient, epi: EpiClient, getJupiterApi: () => JupiterApiClient);
72
- get jupiterApi(): JupiterApiClient;
73
- get cachedStateModel(): StateModel | null;
74
- set cachedStateModel(stateModel: StateModel);
75
- get lookupTables(): PublicKey[];
76
- get kaminoVaults(): PublicKey[];
77
- private getKaminoObligationReserveSets;
78
- /**
79
- * Fetches all holdings in the vault.
80
- *
81
- * The source of truth for external positions is the `externalPositions` array
82
- * from the state account, which tracks:
83
- * - Kamino obligation accounts (lending positions)
84
- * - Kamino vault share ATAs (shares in kamino vaults)
85
- *
86
- * @param commitment Commitment level for fetching accounts
87
- * @param priceBaseAssetMint Price reference/numeraire asset mint (default: PublicKey.default for USD).
88
- * Pass a token mint (e.g., WSOL) to get prices denominated in that asset.
89
- * @returns VaultHoldings object containing all holdings
90
- */
91
- getVaultHoldings(commitment: Commitment, priceBaseAssetMint?: PublicKey): Promise<VaultHoldings>;
92
- getPubkeysForTokenHoldings(externalPositionsSet: PkSet, commitment?: Commitment): Promise<PublicKey[]>;
93
- /**
94
- * Gets kamino obligation reserves from known obligation pubkeys.
95
- */
96
- getPubkeysForKaminoHoldings(obligationPubkeys: PublicKey[], commitment?: Commitment): Promise<PkMap<PkSet>>;
97
- /**
98
- * Gets kamino vault states from known share ATA pubkeys.
99
- * Used by getVaultHoldingsV2 to process vault shares from externalPositions.
100
- */
101
- getKaminoVaultStatesFromAtas(shareAtaPubkeys: PublicKey[], commitment?: Commitment): Promise<PkMap<KVaultState>>;
102
- /**
103
- * Fetches token price from the prefetched map, falling back to Jupiter API if not found.
104
- * @throws Error if price cannot be fetched from either source
105
- */
106
- private getTokenPrice;
107
- getTokenHoldings(tokenAccountPubkeys: PublicKey[], accountsDataMap: PkMap<Buffer>, tokenPricesMap: PkMap<TokenListItem>, priceSource: string): Promise<Holding[]>;
108
- getKaminoLendHoldings(obligationPubkeys: Iterable<PublicKey>, reservesMap: PkMap<Reserve>, accountsDataMap: PkMap<Buffer>, tokenPricesMap: PkMap<TokenListItem>, priceSource: string): Promise<Holding[]>;
109
- getKaminoVaultsHoldings(kvaultAtasAndStates: PkMap<KVaultState>, reservesMap: PkMap<Reserve>, accountsDataMap: PkMap<Buffer>, tokenPricesMap: PkMap<TokenListItem>, priceSource: string): Promise<Holding[]>;
110
- /**
111
- * Returns an instruction that prices Kamino obligations.
112
- * If there are no Kamino obligations, returns null.
113
- */
114
- priceKaminoObligationsIxs(): Promise<PricingChunk>;
115
- priceKaminoVaultSharesIx(): Promise<PricingChunk | null>;
116
- /**
117
- * Returns an instruction that prices vault balance and tokens
118
- */
119
- priceVaultTokensIx(): Promise<PricingChunk>;
120
- /**
121
- * Returns an instruction that prices stake accounts.
122
- * If there are no stake accounts, returns null.
123
- */
124
- priceStakeAccountsIx(): Promise<TransactionInstruction | null>;
125
- priceVaultIxs(): Promise<TransactionInstruction[]>;
126
- private enqueuePriceVaultIxs;
127
- private priceManagedTransfersIxs;
128
- private priceNeutralBundleDepositorsIx;
129
- private priceEpiValidatedPositionsIx;
130
- private _priceVaultIxsImpl;
131
- validateAumIx(): Promise<TransactionInstruction>;
132
- getBaseAssetOracle(): Promise<PublicKey>;
133
- remainingAccountsForPricingVaultAssets(): Promise<[
134
- AccountMeta[],
135
- PublicKey[]
136
- ]>;
137
- }
138
- export {};
@@ -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 {};
@@ -1,34 +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
- declare class TxBuilder extends BaseTxBuilder<StakeClient> {
5
- initializeAndDelegateStakeIxs(vote: PublicKey, amount: BN, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey]>;
6
- initializeAndDelegateStakeTx(vote: PublicKey, amount: BN, txOptions?: TxOptions): Promise<[VersionedTransaction, PublicKey]>;
7
- deactivateStakesIx(stakeAccounts: PublicKey[], glamSigner: PublicKey): Promise<TransactionInstruction>;
8
- deactivateStakesTx(stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
9
- withdrawStakesIx(stakeAccounts: PublicKey[], glamSigner: PublicKey): Promise<TransactionInstruction>;
10
- withdrawStakesTx(stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
11
- mergeStakeIx(destinationStake: PublicKey, sourceStake: PublicKey, glamSigner: PublicKey): Promise<TransactionInstruction>;
12
- mergeStakeTx(destinationStake: PublicKey, sourceStake: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
13
- splitStakeIxs(existingStake: PublicKey, lamports: BN, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey]>;
14
- splitStakeTx(existingStake: PublicKey, lamports: BN, txOptions?: TxOptions): Promise<[VersionedTransaction, PublicKey]>;
15
- moveStakeIx(sourceStake: PublicKey, destinationStake: PublicKey, amount: BN, glamSigner: PublicKey): Promise<any>;
16
- moveStakeTx(sourceStake: PublicKey, destinationStake: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
17
- }
18
- export declare class StakeClient {
19
- readonly base: BaseClient;
20
- readonly txBuilder: TxBuilder;
21
- constructor(base: BaseClient);
22
- initializeAndDelegateStake(vote: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
23
- deactivate(stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
24
- withdraw(stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
25
- merge(destinationStake: PublicKey, sourceStake: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
26
- split(existingStake: PublicKey, lamports: BN, txOptions?: TxOptions): Promise<{
27
- newStake: PublicKey;
28
- txSig: TransactionSignature;
29
- }>;
30
- move(sourceStake: PublicKey, destinationStake: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
31
- getStakeAccountVoter(stakeAccount: PublicKey): Promise<PublicKey | null>;
32
- createStakeAccount(signer: PublicKey): Promise<[PublicKey, TransactionInstruction]>;
33
- }
34
- export {};
@@ -1,56 +0,0 @@
1
- import { VersionedTransaction, TransactionSignature, PublicKey, TransactionInstruction } from "@solana/web3.js";
2
- import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
3
- import { StateIdlModel, StateAccountType } from "../models";
4
- export type InitStateParams = {
5
- accountType: StateAccountType;
6
- name: number[];
7
- baseAssetMint: PublicKey;
8
- } & Partial<StateIdlModel>;
9
- /**
10
- * A subset of StateIdlModel fields that are updatable using updateState instruction
11
- */
12
- export type UpdateStateParams = {
13
- name?: number[];
14
- owner?: PublicKey;
15
- portfolioManagerName?: number[];
16
- timelockDuration?: number;
17
- assets?: PublicKey[];
18
- borrowable?: PublicKey[];
19
- };
20
- declare class TxBuilder extends BaseTxBuilder<StateClient> {
21
- initializeIx(params: InitStateParams, glamSigner: PublicKey): Promise<[TransactionInstruction, PublicKey]>;
22
- initializeTx(params: InitStateParams, txOptions?: TxOptions): Promise<[VersionedTransaction, PublicKey]>;
23
- updateIx(params: UpdateStateParams, glamSigner: PublicKey): Promise<TransactionInstruction>;
24
- updateTx(params: UpdateStateParams, txOptions: TxOptions): Promise<VersionedTransaction>;
25
- extendIx(newBytes: number, glamSigner: PublicKey): Promise<TransactionInstruction>;
26
- extendTx(newBytes: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
27
- closeIx(glamSigner: PublicKey): Promise<TransactionInstruction>;
28
- closeTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
29
- }
30
- export declare class StateClient {
31
- readonly base: BaseClient;
32
- readonly txBuilder: TxBuilder;
33
- constructor(base: BaseClient);
34
- /**
35
- * Creates a new GLAM state
36
- */
37
- initialize(params: InitStateParams, txOptions?: TxOptions): Promise<TransactionSignature>;
38
- /**
39
- * Updates the GLAM state account.
40
- *
41
- * If no timelock , the updates will be applied immediately.
42
- * If timelock is enabled, the updates will be staged and can be applied after the timelock period.
43
- *
44
- * Only the fields provided in `params` will be updated; omitted fields remain unchanged.
45
- */
46
- update(params: UpdateStateParams, txOptions?: TxOptions): Promise<TransactionSignature>;
47
- /**
48
- * Extends GLAM state account size
49
- */
50
- extend(newBytes: number, txOptions?: TxOptions): Promise<TransactionSignature>;
51
- /**
52
- * Closes GLAM state account
53
- */
54
- close(txOptions?: TxOptions): Promise<TransactionSignature>;
55
- }
56
- export {};
@@ -1,31 +0,0 @@
1
- import { VersionedTransaction, TransactionSignature, PublicKey, TransactionInstruction } from "@solana/web3.js";
2
- import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
3
- import { StateClient } from "./state";
4
- declare class TxBuilder extends BaseTxBuilder<TimelockClient> {
5
- applyStateTimelockIx(glamSigner: PublicKey): Promise<TransactionInstruction>;
6
- applyStateTimelockTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
7
- applyMintTimelockIx(glamSigner: PublicKey): Promise<TransactionInstruction>;
8
- applyMintTimelockTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
9
- cancelTimelockIx(glamSigner: PublicKey): Promise<TransactionInstruction>;
10
- cancelTimelockTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
11
- }
12
- export declare class TimelockClient {
13
- readonly base: BaseClient;
14
- readonly stateClient: StateClient;
15
- readonly txBuilder: TxBuilder;
16
- constructor(base: BaseClient, stateClient: StateClient);
17
- /**
18
- * Sets the timelock duration in seconds
19
- * @param durationSeconds Duration in seconds for timelock period
20
- */
21
- set(durationSeconds: number, txOptions?: TxOptions): Promise<TransactionSignature>;
22
- /**
23
- * Applies pending timelock updates after timelock expires.
24
- */
25
- apply(txOptions?: TxOptions): Promise<TransactionSignature>;
26
- /**
27
- * Cancels pending timelock updates
28
- */
29
- cancel(txOptions?: TxOptions): Promise<TransactionSignature>;
30
- }
31
- export {};