@glamsystems/glam-sdk 1.0.14-alpha.4 → 1.0.14-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/index.cjs.js +50322 -20832
  2. package/index.esm.js +50167 -20833
  3. package/package.json +3 -3
  4. package/target/idl/ext_jupiter-staging.json +1960 -0
  5. package/target/idl/ext_jupiter.json +1960 -0
  6. package/target/idl/ext_orca-staging.json +2797 -0
  7. package/target/idl/ext_orca.json +2797 -0
  8. package/target/idl/glam_mint-staging.json +1452 -80
  9. package/target/idl/glam_mint.json +256 -1
  10. package/target/idl/glam_protocol-staging.json +22 -2
  11. package/target/idl/glam_protocol.json +584 -0
  12. package/target/types/ext_jupiter-staging.ts +1966 -0
  13. package/target/types/ext_jupiter.ts +1966 -0
  14. package/target/types/ext_orca-staging.ts +2803 -0
  15. package/target/types/ext_orca.ts +2803 -0
  16. package/target/types/glam_mint-staging.ts +1452 -80
  17. package/target/types/glam_mint.ts +256 -1
  18. package/target/types/glam_protocol-staging.ts +22 -2
  19. package/target/types/glam_protocol.ts +584 -0
  20. package/src/assets.d.ts +0 -40
  21. package/src/client/access.d.ts +0 -57
  22. package/src/client/base.d.ts +0 -180
  23. package/src/client/bridge.d.ts +0 -185
  24. package/src/client/bridgeRegistry.d.ts +0 -32
  25. package/src/client/cctp.d.ts +0 -156
  26. package/src/client/epi.d.ts +0 -78
  27. package/src/client/fees.d.ts +0 -33
  28. package/src/client/invest.d.ts +0 -37
  29. package/src/client/jupiter.d.ts +0 -45
  30. package/src/client/kamino/farm.d.ts +0 -39
  31. package/src/client/kamino/index.d.ts +0 -4
  32. package/src/client/kamino/lending.d.ts +0 -86
  33. package/src/client/kamino/types.d.ts +0 -56
  34. package/src/client/kamino/vaults.d.ts +0 -31
  35. package/src/client/marinade.d.ts +0 -42
  36. package/src/client/mint.d.ts +0 -127
  37. package/src/client/price.d.ts +0 -128
  38. package/src/client/stake-pool.d.ts +0 -39
  39. package/src/client/stake.d.ts +0 -34
  40. package/src/client/state.d.ts +0 -56
  41. package/src/client/timelock.d.ts +0 -31
  42. package/src/client/vault.d.ts +0 -90
  43. package/src/client.d.ts +0 -62
  44. package/src/clientConfig.d.ts +0 -29
  45. package/src/constants.d.ts +0 -82
  46. package/src/deser/base.d.ts +0 -18
  47. package/src/deser/index.d.ts +0 -3
  48. package/src/deser/integrationPolicies.d.ts +0 -106
  49. package/src/deser/kaminoLayouts.d.ts +0 -264
  50. package/src/deser/tokenAclLayouts.d.ts +0 -67
  51. package/src/error.d.ts +0 -29
  52. package/src/glamExports.d.ts +0 -5563
  53. package/src/globalConfig.d.ts +0 -22
  54. package/src/index.d.ts +0 -18
  55. package/src/models/acl.d.ts +0 -43
  56. package/src/models/index.d.ts +0 -8
  57. package/src/models/mint.d.ts +0 -64
  58. package/src/models/state.d.ts +0 -104
  59. package/src/models/types.d.ts +0 -28
  60. package/src/react/cluster-provider.d.ts +0 -22
  61. package/src/react/glam.d.ts +0 -47
  62. package/src/react/index.d.ts +0 -5
  63. package/src/react/query-keys.d.ts +0 -38
  64. package/src/react/useVaultBalanceSubscription.d.ts +0 -17
  65. package/src/utils/accounts.d.ts +0 -72
  66. package/src/utils/bitmask.d.ts +0 -53
  67. package/src/utils/blockhash.d.ts +0 -11
  68. package/src/utils/common.d.ts +0 -37
  69. package/src/utils/computeBudget.d.ts +0 -15
  70. package/src/utils/evm.d.ts +0 -10
  71. package/src/utils/fraction.d.ts +0 -29
  72. package/src/utils/glamPDAs.d.ts +0 -14
  73. package/src/utils/index.d.ts +0 -16
  74. package/src/utils/jupiterApi.d.ts +0 -89
  75. package/src/utils/lookupTables.d.ts +0 -53
  76. package/src/utils/pkmap.d.ts +0 -82
  77. package/src/utils/pkset.d.ts +0 -73
  78. package/src/utils/positionCategorizer.d.ts +0 -36
  79. package/src/utils/rpc.d.ts +0 -33
  80. package/src/utils/timelock.d.ts +0 -52
  81. package/src/utils/transaction.d.ts +0 -13
  82. package/target/types/ext_bridge.d.ts +0 -2385
  83. package/target/types/ext_cctp.d.ts +0 -1268
  84. package/target/types/ext_epi.d.ts +0 -2175
  85. package/target/types/ext_kamino.d.ts +0 -3433
  86. package/target/types/ext_marinade.d.ts +0 -1593
  87. package/target/types/ext_spl.d.ts +0 -1274
  88. package/target/types/ext_stake_pool.d.ts +0 -1622
  89. package/target/types/glam_config.d.ts +0 -755
  90. package/target/types/glam_mint.d.ts +0 -6094
  91. package/target/types/glam_protocol.d.ts +0 -2708
@@ -1,264 +0,0 @@
1
- import { BN } from "@coral-xyz/anchor";
2
- import { PublicKey } from "@solana/web3.js";
3
- import { BigFractionBytes } from "../utils";
4
- import { Decodable } from "./base";
5
- import Decimal from "decimal.js";
6
- export interface KVaultAllocation {
7
- reserve: PublicKey;
8
- ctokenVault: PublicKey;
9
- targetAllocationWeight: BN;
10
- tokenAllocationCap: BN;
11
- ctokenVaultBump: BN;
12
- configPadding: BN[];
13
- ctokenAllocation: BN;
14
- lastInvestSlot: BN;
15
- tokenTargetAllocationSf: BN;
16
- statePadding: BN[];
17
- }
18
- export declare class KVaultState extends Decodable {
19
- discriminator: number[];
20
- vaultAdminAuthority: PublicKey;
21
- baseVaultAuthority: PublicKey;
22
- baseVaultAuthorityBump: BN;
23
- tokenMint: PublicKey;
24
- tokenMintDecimals: BN;
25
- tokenVault: PublicKey;
26
- tokenProgram: PublicKey;
27
- sharesMint: PublicKey;
28
- sharesMintDecimals: BN;
29
- tokenAvailable: BN;
30
- sharesIssued: BN;
31
- availableCrankFunds: BN;
32
- padding0: BN;
33
- performanceFeeBps: BN;
34
- managementFeeBps: BN;
35
- lastFeeChargeTimestamp: BN;
36
- prevAumSf: BN;
37
- pendingFeesSf: BN;
38
- vaultAllocationStrategy: KVaultAllocation[];
39
- padding1: BN[];
40
- minDepositAmount: BN;
41
- minWithdrawAmount: BN;
42
- minInvestAmount: BN;
43
- minInvestDelaySlots: BN;
44
- crankFundFeePerReserve: BN;
45
- pendingAdmin: PublicKey;
46
- cumulativeEarnedInterestSf: BN;
47
- cumulativeMgmtFeesSf: BN;
48
- cumulativePerfFeesSf: BN;
49
- name: number[];
50
- vaultLookupTable: PublicKey;
51
- vaultFarm: PublicKey;
52
- creationTimestamp: BN;
53
- padding2: BN;
54
- allocationAdmin: PublicKey;
55
- padding3: BN[];
56
- static _layout: any;
57
- get nameStr(): string;
58
- get validAllocations(): KVaultAllocation[];
59
- }
60
- interface LastUpdate {
61
- slot: BN;
62
- stale: number;
63
- priceStatus: number;
64
- placeholder: number[];
65
- }
66
- interface PriceHeuristic {
67
- lower: BN;
68
- upper: BN;
69
- exp: BN;
70
- }
71
- interface ScopeConfiguration {
72
- priceFeed: PublicKey;
73
- priceChain: number[];
74
- twapChain: number[];
75
- }
76
- interface SwitchboardConfiguration {
77
- priceAggregator: PublicKey;
78
- twapAggregator: PublicKey;
79
- }
80
- interface PythConfiguration {
81
- price: PublicKey;
82
- }
83
- interface TokenInfo {
84
- name: number[];
85
- heuristic: PriceHeuristic;
86
- maxTwapDivergenceBps: BN;
87
- maxAgePriceSeconds: BN;
88
- maxAgeTwapSeconds: BN;
89
- scopeConfiguration: ScopeConfiguration;
90
- switchboardConfiguration: SwitchboardConfiguration;
91
- pythConfiguration: PythConfiguration;
92
- blockPriceUsage: number;
93
- reserved: number[];
94
- padding: BN[];
95
- }
96
- interface ReserveFees {
97
- borrowFeeSf: BN;
98
- flashLoanFeeSf: BN;
99
- padding: number[];
100
- }
101
- interface CurvePoint {
102
- utilizationRateBps: number;
103
- borrowRateBps: number;
104
- }
105
- interface BorrowRateCurve {
106
- points: CurvePoint[];
107
- }
108
- interface WithdrawalCaps {
109
- configCapacity: BN;
110
- currentTotal: BN;
111
- lastIntervalStartTimestamp: BN;
112
- configIntervalLengthSeconds: BN;
113
- }
114
- interface ReserveLiquidity {
115
- mintPubkey: PublicKey;
116
- supplyVault: PublicKey;
117
- feeVault: PublicKey;
118
- availableAmount: BN;
119
- borrowedAmountSf: BN;
120
- marketPriceSf: BN;
121
- marketPriceLastUpdatedTs: BN;
122
- mintDecimals: BN;
123
- depositLimitCrossedTimestamp: BN;
124
- borrowLimitCrossedTimestamp: BN;
125
- cumulativeBorrowRateBsf: BigFractionBytes;
126
- accumulatedProtocolFeesSf: BN;
127
- accumulatedReferrerFeesSf: BN;
128
- pendingReferrerFeesSf: BN;
129
- absoluteReferralRateSf: BN;
130
- tokenProgram: PublicKey;
131
- padding2: BN[];
132
- padding3: BN[];
133
- }
134
- interface ReserveCollateral {
135
- mintPubkey: PublicKey;
136
- mintTotalSupply: BN;
137
- supplyVault: PublicKey;
138
- padding1: BN[];
139
- padding2: BN[];
140
- }
141
- interface ReserveConfig {
142
- status: number;
143
- assetTier: number;
144
- hostFixedInterestRateBps: number;
145
- reserved2: number[];
146
- protocolOrderExecutionFeePct: number;
147
- protocolTakeRatePct: number;
148
- protocolLiquidationFeePct: number;
149
- loanToValuePct: number;
150
- liquidationThresholdPct: number;
151
- minLiquidationBonusBps: number;
152
- maxLiquidationBonusBps: number;
153
- badDebtLiquidationBonusBps: number;
154
- deleveragingMarginCallPeriodSecs: BN;
155
- deleveragingThresholdDecreaseBpsPerDay: BN;
156
- fees: ReserveFees;
157
- borrowRateCurve: BorrowRateCurve;
158
- borrowFactorPct: BN;
159
- depositLimit: BN;
160
- borrowLimit: BN;
161
- tokenInfo: TokenInfo;
162
- depositWithdrawalCap: WithdrawalCaps;
163
- debtWithdrawalCap: WithdrawalCaps;
164
- elevationGroups: number[];
165
- disableUsageAsCollOutsideEmode: number;
166
- utilizationLimitBlockBorrowingAbovePct: number;
167
- autodeleverageEnabled: number;
168
- reserved1: number[];
169
- borrowLimitOutsideElevationGroup: BN;
170
- borrowLimitAgainstThisCollateralInElevationGroup: BN[];
171
- }
172
- export declare class Reserve extends Decodable {
173
- discriminator: number[];
174
- version: BN;
175
- lastUpdate: LastUpdate;
176
- lendingMarket: PublicKey;
177
- farmCollateral: PublicKey;
178
- farmDebt: PublicKey;
179
- liquidity: ReserveLiquidity;
180
- reserveLiquidityPadding: BN[];
181
- collateral: ReserveCollateral;
182
- reserveCollateralPadding: BN[];
183
- config: ReserveConfig;
184
- configPadding: BN[];
185
- borrowedAmountOutsideElevationGroup: BN;
186
- borrowedAmountsAgainstThisReserveInElevationGroups: BN[];
187
- padding: BN[];
188
- static _layout: any;
189
- get cumulativeBorrowRate(): Decimal;
190
- /**
191
- * @returns the stale exchange rate between the collateral tokens and the liquidity - this is a decimal number scaled by 1e18
192
- */
193
- get collateralExchangeRate(): Decimal;
194
- get totalSupply(): Decimal;
195
- get borrowedAmount(): Decimal;
196
- get accumulatedProtocolFees(): Decimal;
197
- get accumulatedReferrerFees(): Decimal;
198
- get pendingReferrerFees(): Decimal;
199
- get scopePriceFeed(): PublicKey;
200
- get liquidityFeeReceiver(): PublicKey;
201
- get farmDebtNullable(): PublicKey | null;
202
- get farmCollateralNullable(): PublicKey | null;
203
- }
204
- interface ObligationCollateral {
205
- depositReserve: PublicKey;
206
- depositedAmount: BN;
207
- marketValueSf: BN;
208
- borrowedAmountAgainstThisCollateralInElevationGroup: BN;
209
- padding: BN[];
210
- }
211
- interface ObligationLiquidity {
212
- borrowReserve: PublicKey;
213
- cumulativeBorrowRateBsf: BigFractionBytes;
214
- padding: BN;
215
- borrowedAmountSf: BN;
216
- marketValueSf: BN;
217
- borrowFactorAdjustedMarketValueSf: BN;
218
- borrowedAmountOutsideElevationGroups: BN;
219
- padding2: BN[];
220
- }
221
- interface ObligationOrder {
222
- conditionThresholdSf: BN;
223
- opportunityParameterSf: BN;
224
- minExecutionBonusBps: number;
225
- maxExecutionBonusBps: number;
226
- conditionType: number;
227
- opportunityType: number;
228
- padding1: number[];
229
- padding2: BN[];
230
- }
231
- export declare class Obligation extends Decodable {
232
- discriminator: number[];
233
- tag: BN;
234
- lastUpdate: LastUpdate;
235
- lendingMarket: PublicKey;
236
- owner: PublicKey;
237
- deposits: ObligationCollateral[];
238
- lowestReserveDepositLiquidationLtv: BN;
239
- depositedValueSf: BN;
240
- borrows: ObligationLiquidity[];
241
- borrowFactorAdjustedDebtValueSf: BN;
242
- borrowedAssetsMarketValueSf: BN;
243
- allowedBorrowValueSf: BN;
244
- unhealthyBorrowValueSf: BN;
245
- depositsAssetTiers: number[];
246
- borrowsAssetTiers: number[];
247
- elevationGroup: number;
248
- numOfObsoleteDepositReserves: number;
249
- hasDebt: number;
250
- referrer: PublicKey;
251
- borrowingDisabled: number;
252
- autodeleverageTargetLtvPct: number;
253
- lowestReserveDepositMaxLtvPct: number;
254
- numOfObsoleteBorrowReserves: number;
255
- reserved: number[];
256
- highestBorrowFactorPct: BN;
257
- autodeleverageMarginCallStartedTimestamp: BN;
258
- orders: ObligationOrder[];
259
- padding3: BN[];
260
- static _layout: any;
261
- get activeDeposits(): ObligationCollateral[];
262
- get activeBorrows(): ObligationLiquidity[];
263
- }
264
- export {};
@@ -1,67 +0,0 @@
1
- import { BN } from "@coral-xyz/anchor";
2
- import { PublicKey } from "@solana/web3.js";
3
- import { Decodable } from "./base";
4
- /**
5
- * Token ACL Gate ListConfig account layout.
6
- *
7
- * Onchain repr(C):
8
- * discriminator: u8
9
- * authority: Pubkey
10
- * seed: Pubkey
11
- * mode: u8
12
- * wallets_count: u64 (LE)
13
- *
14
- * PDA seeds: ["list_config", authority, seed]
15
- * Program: Token ACL Gate
16
- */
17
- export declare class TokenAclListConfig extends Decodable {
18
- discriminator: number;
19
- authority: PublicKey;
20
- seed: PublicKey;
21
- mode: number;
22
- walletsCount: BN;
23
- static _layout: any;
24
- get modeName(): string;
25
- }
26
- /**
27
- * Token ACL Gate WalletEntry account layout.
28
- *
29
- * Onchain repr(C):
30
- * discriminator: u8
31
- * wallet_address: Pubkey
32
- * list_config: Pubkey
33
- *
34
- * PDA seeds: ["wallet_entry", list_config, wallet]
35
- * Program: Token ACL Gate
36
- */
37
- export declare class TokenAclWalletEntry extends Decodable {
38
- discriminator: number;
39
- wallet: PublicKey;
40
- listConfig: PublicKey;
41
- static _layout: any;
42
- }
43
- /**
44
- * Token ACL MintConfig account layout.
45
- *
46
- * Onchain repr(C):
47
- * discriminator: u8
48
- * bump: u8
49
- * enable_permissionless_thaw: PodBool (u8)
50
- * enable_permissionless_freeze: PodBool (u8)
51
- * mint: Pubkey
52
- * freeze_authority: Pubkey
53
- * gating_program: Pubkey
54
- *
55
- * PDA seeds: ["MINT_CONFIG", mint]
56
- * Program: Token ACL
57
- */
58
- export declare class TokenAclMintConfig extends Decodable {
59
- discriminator: number;
60
- bump: number;
61
- enablePermissionlessThaw: number;
62
- enablePermissionlessFreeze: number;
63
- mint: PublicKey;
64
- freezeAuthority: PublicKey;
65
- gatingProgram: PublicKey;
66
- static _layout: any;
67
- }
package/src/error.d.ts DELETED
@@ -1,29 +0,0 @@
1
- import { TransactionError } from "@solana/web3.js";
2
- export declare class GlamError extends Error {
3
- message: string;
4
- rawError: TransactionError | null | undefined;
5
- programLogs?: string[];
6
- constructor(message: string, rawError: TransactionError | null | undefined, programLogs?: string[]);
7
- }
8
- /**
9
- * Extract the program ID that failed from transaction logs.
10
- * Looks for "Program <ID> failed:" log lines and returns the first match,
11
- * which corresponds to the innermost CPI that produced the root cause.
12
- */
13
- export declare function extractFailedProgramId(logs?: string[] | null): string | undefined;
14
- /**
15
- * Resolve a custom program error code to a human-readable message.
16
- * When programId is provided, matches against the specific program's IDL
17
- * to avoid collisions between programs using the same error code range.
18
- * Accepts either a decimal number or a hex string (e.g. "0xBB80").
19
- */
20
- export declare function resolveErrorCode(code: number | string, staging?: boolean, programId?: string): string | undefined;
21
- /**
22
- * Parse the error message from a transaction error.
23
- * Environment-agnostic: handles Anchor errors, program error codes,
24
- * simulation failures, and common RPC/network errors.
25
- *
26
- * Callers (GUI, CLI) can handle environment-specific error types
27
- * (e.g. WalletSignTransactionError) before delegating to this function.
28
- */
29
- export declare function parseTxError(error: any): string;