@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,84 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- export declare const SEED_STATE = "state";
3
- export declare const SEED_VAULT = "vault";
4
- export declare const SEED_METADATA = "metadata";
5
- export declare const SEED_MINT = "mint";
6
- export declare const SEED_ESCROW = "escrow";
7
- export declare const SEED_REQUEST_QUEUE = "request-queue";
8
- export declare const SEED_ACCOUNT_POLICY = "account-policy";
9
- export declare const SEED_EXTRA_ACCOUNT_METAS = "extra-account-metas";
10
- export declare const SEED_GLOBAL_CONFIG = "global-config";
11
- export declare const SEED_INTEGRATION_AUTHORITY = "integration-authority";
12
- export declare const SEED_OBSERVATION_STATE = "observation-state";
13
- export declare const SEED_BRIDGE_REGISTRY = "bridge-registry";
14
- export declare const SEED_BRIDGE_SESSION = "bridge-session";
15
- export declare const SEED_BRIDGE_TRANSFER_RECORD = "bridge-transfer-record";
16
- export declare const STAKE_ACCOUNT_SIZE = 200;
17
- export declare const METEORA_POSITION_SIZE = 8120;
18
- export declare const KAMINO_OBTRIGATION_SIZE = 3344;
19
- export declare const KAMINO_RESERVE_SIZE = 8624;
20
- export declare const KAMINO_VAULT_STATE_SIZE = 62552;
21
- export declare const JITO_TIP_DEFAULT: PublicKey;
22
- export declare const MARINADE_NATIVE_STAKE_AUTHORITY: PublicKey;
23
- /**
24
- * Token mints. If no devnet version is defined, assume mainnet and devnet addresses are the same.
25
- *
26
- * Unless otherwise noted, all mints have 9 decimals.
27
- */
28
- export declare const WSOL: PublicKey;
29
- export declare const MSOL: PublicKey;
30
- export declare const USDC: PublicKey;
31
- export declare const USDC_DEVNET: PublicKey;
32
- export declare const USDT: PublicKey;
33
- export declare const JUP: PublicKey;
34
- /**
35
- * Program IDs
36
- */
37
- export declare const MARINADE_PROGRAM_ID: PublicKey;
38
- export declare const JUPITER_PROGRAM_ID: PublicKey;
39
- export declare const SANCTUM_STAKE_POOL_PROGRAM_ID: PublicKey;
40
- export declare const KAMINO_LENDING_PROGRAM: PublicKey;
41
- export declare const KAMINO_VAULTS_PROGRAM: PublicKey;
42
- export declare const KAMINO_FARM_PROGRAM: PublicKey;
43
- export declare const MEMO_PROGRAM: PublicKey;
44
- export declare const ALT_PROGRAM_ID: PublicKey;
45
- export declare const TOKEN_MESSENGER_MINTER_V2: PublicKey;
46
- export declare const MESSAGE_TRANSMITTER_V2: PublicKey;
47
- export declare const LOOPSCALE_PROGRAM_ID: PublicKey;
48
- export declare const NTBUNDLE_PROGRAM_ID: PublicKey;
49
- /**
50
- * Token ACL (sRFC-37)
51
- */
52
- export declare const TOKEN_ACL_PROGRAM: PublicKey;
53
- export declare const TOKEN_ACL_GATE_PROGRAM: PublicKey;
54
- /**
55
- * GLAM programs
56
- */
57
- export declare const TRANSFER_HOOK_PROGRAM: PublicKey;
58
- export declare const GLAM_CONFIG_PROGRAM: PublicKey;
59
- /**
60
- * Referrers
61
- */
62
- export declare const GLAM_REFERRER: PublicKey;
63
- /**
64
- * CCTP domain to chain name mapping
65
- */
66
- export declare const CCTP_DOMAIN_MAPPING: Record<number, string>;
67
- /**
68
- * Get protocol and permission mappings at runtime to ensure correct program IDs based on environment.
69
- *
70
- * This method provides the source of truth for protocol and permission mappings and staging status in SDK.
71
- */
72
- export declare const getProtocolsAndPermissions: (staging: boolean) => Record<string, Record<string, {
73
- name: string;
74
- staging: boolean;
75
- permissions: Record<number, string>;
76
- }>>;
77
- /**
78
- * (Program ID, Bitflag) -> Protocol Name
79
- */
80
- export declare const getProtocolNameByProgramAndBitflag: (staging: boolean) => Record<string, Record<string, string>>;
81
- /**
82
- * Protocol Name -> (Program ID, Bitflag)
83
- */
84
- export declare const getProgramAndBitflagByProtocolName: (staging: boolean) => Record<string, [string, string]>;
@@ -1,18 +0,0 @@
1
- import { struct } from "@coral-xyz/borsh";
2
- import { PublicKey } from "@solana/web3.js";
3
- /**
4
- * Base class for decodable on-chain account structures.
5
- *
6
- * This class provides a generic decode method that can be inherited by all
7
- * account deserializer classes, eliminating the need to implement the same
8
- * decode logic in each class.
9
- */
10
- export declare abstract class Decodable {
11
- readonly _address: PublicKey;
12
- static _layout: ReturnType<typeof struct>;
13
- static decode<T extends Decodable>(this: {
14
- new (): T;
15
- _layout: ReturnType<typeof struct>;
16
- }, address: PublicKey, buffer: Buffer): T;
17
- getAddress(): PublicKey;
18
- }
@@ -1,3 +0,0 @@
1
- export { Decodable } from "./base";
2
- export * from "./kaminoLayouts";
3
- export * from "./tokenAclLayouts";
@@ -1,120 +0,0 @@
1
- import { BN } from "@coral-xyz/anchor";
2
- import { PublicKey } from "@solana/web3.js";
3
- export declare class MintPolicy {
4
- lockupPeriod: number;
5
- maxCap: BN;
6
- minSubscription: BN;
7
- minRedemption: BN;
8
- reserved: BN;
9
- allowlist: PublicKey[] | null;
10
- blocklist: PublicKey[] | null;
11
- static _layout: any;
12
- constructor(lockupPeriod: number, maxCap: BN, minSubscription: BN, minRedemption: BN, reserved: BN, allowlist: PublicKey[] | null, blocklist: PublicKey[] | null);
13
- static decode(buffer: Buffer): MintPolicy;
14
- encode(): Buffer;
15
- }
16
- export declare class JupiterSwapPolicy {
17
- maxSlippageBps: number;
18
- swapAllowlist: PublicKey[] | null;
19
- maxDeviationBps: number;
20
- constructor(maxSlippageBps: number, swapAllowlist: PublicKey[] | null, maxDeviationBps?: number);
21
- static decode(buffer: Buffer<ArrayBufferLike>): JupiterSwapPolicy;
22
- encode(): Buffer;
23
- }
24
- export declare class TransferPolicy {
25
- allowlist: PublicKey[];
26
- static _layout: any;
27
- constructor(allowlist: PublicKey[]);
28
- static decode(buffer: Buffer<ArrayBufferLike>): TransferPolicy;
29
- encode(): Buffer;
30
- }
31
- export declare class KaminoLendingPolicy {
32
- marketsAllowlist: PublicKey[];
33
- borrowAllowlist: PublicKey[];
34
- static _layout: any;
35
- constructor(marketsAllowlist: PublicKey[], borrowAllowlist: PublicKey[]);
36
- static decode(buffer: Buffer<ArrayBufferLike>): KaminoLendingPolicy;
37
- encode(): Buffer;
38
- }
39
- export declare class KaminoVaultsPolicy {
40
- vaultsAllowlist: PublicKey[];
41
- static _layout: any;
42
- constructor(vaultsAllowlist: PublicKey[]);
43
- static decode(buffer: Buffer<ArrayBufferLike>): KaminoVaultsPolicy;
44
- encode(): Buffer;
45
- }
46
- export declare class LoopscalePolicy {
47
- strategiesAllowlist: PublicKey[];
48
- static _layout: any;
49
- constructor(strategiesAllowlist: PublicKey[]);
50
- static decode(buffer: Buffer<ArrayBufferLike>): LoopscalePolicy;
51
- encode(): Buffer;
52
- }
53
- export declare class NeutralPolicy {
54
- bundlesAllowlist: PublicKey[];
55
- static _layout: any;
56
- constructor(bundlesAllowlist: PublicKey[]);
57
- static decode(buffer: Buffer<ArrayBufferLike>): NeutralPolicy;
58
- encode(): Buffer;
59
- }
60
- export declare class CctpPolicy {
61
- allowedDestinations: {
62
- domain: number;
63
- address: PublicKey;
64
- }[];
65
- static _layout: any;
66
- constructor(allowedDestinations: {
67
- domain: number;
68
- address: PublicKey;
69
- }[]);
70
- static decode(buffer: Buffer<ArrayBufferLike>): CctpPolicy;
71
- encode(): Buffer;
72
- get domainToAddressesMap(): Map<number, PublicKey[]>;
73
- }
74
- export declare enum RouteManagementMode {
75
- UnmanagedOnly = 0,
76
- ManagedOnly = 1,
77
- Either = 2
78
- }
79
- export type LayerzeroOftRoute = {
80
- sourceMint: PublicKey;
81
- destinationChain: number;
82
- destinationRecipient: PublicKey;
83
- providerProgram: PublicKey;
84
- managementMode: RouteManagementMode;
85
- minAmount: BN;
86
- maxAmount: BN;
87
- };
88
- export declare class LayerzeroOftPolicy {
89
- routes: LayerzeroOftRoute[];
90
- static _layout: any;
91
- constructor(routes: LayerzeroOftRoute[]);
92
- static decode(buffer: Buffer<ArrayBufferLike>, _staging?: boolean): LayerzeroOftPolicy;
93
- encode(): Buffer;
94
- }
95
- export declare enum PeriodType {
96
- Day = 0,
97
- Week = 1,
98
- Month = 2
99
- }
100
- export interface AssetRateLimit {
101
- mint: PublicKey;
102
- periodType: number;
103
- amount: BN;
104
- }
105
- export interface DelegateRateLimit {
106
- delegate: PublicKey;
107
- limits: AssetRateLimit[];
108
- }
109
- export declare class TransferRateLimitPolicy {
110
- vaultDefaults: AssetRateLimit[];
111
- delegateOverrides: DelegateRateLimit[];
112
- static _layout: any;
113
- constructor(vaultDefaults: AssetRateLimit[], delegateOverrides: DelegateRateLimit[]);
114
- static decode(buffer: Buffer<ArrayBufferLike>): TransferRateLimitPolicy;
115
- encode(): Buffer;
116
- /**
117
- * Derive the TransferTracker PDA address for a given vault state, signer, and mint.
118
- */
119
- static getTransferTrackerPda(glamState: PublicKey, signer: PublicKey, mint: PublicKey, programId: PublicKey): [PublicKey, number];
120
- }
@@ -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;