@glamsystems/glam-sdk 1.1.0-alpha.5 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE +201 -0
  2. package/buffer-layout.d.ts +88 -0
  3. package/index.cjs.d.ts +1 -0
  4. package/index.cjs.js +1 -92594
  5. package/index.esm.d.ts +1 -0
  6. package/index.esm.js +1 -92146
  7. package/package.json +29 -17
  8. package/src/assets.d.ts +39 -0
  9. package/src/client/access.d.ts +57 -0
  10. package/src/client/base.d.ts +234 -0
  11. package/src/client/bridge.d.ts +205 -0
  12. package/src/client/bridgeRegistry.d.ts +32 -0
  13. package/src/client/cctp.d.ts +164 -0
  14. package/src/client/epi.d.ts +228 -0
  15. package/src/client/fees.d.ts +33 -0
  16. package/src/client/invest.d.ts +37 -0
  17. package/src/client/jupiter-lend/borrow.d.ts +92 -0
  18. package/src/client/jupiter-lend/earn.d.ts +64 -0
  19. package/src/client/jupiter-lend/index.d.ts +3 -0
  20. package/src/client/jupiter-lend/shared.d.ts +129 -0
  21. package/src/client/jupiter.d.ts +53 -0
  22. package/src/client/kamino/farm.d.ts +39 -0
  23. package/src/client/kamino/index.d.ts +4 -0
  24. package/src/client/kamino/lending.d.ts +94 -0
  25. package/src/client/kamino/types.d.ts +56 -0
  26. package/src/client/kamino/vaults.d.ts +39 -0
  27. package/src/client/loopscale/borrow.d.ts +118 -0
  28. package/src/client/loopscale/core.d.ts +604 -0
  29. package/src/client/loopscale/index.d.ts +5 -0
  30. package/src/client/loopscale/lend.d.ts +123 -0
  31. package/src/client/loopscale/vault.d.ts +43 -0
  32. package/src/client/marinade.d.ts +42 -0
  33. package/src/client/mint.d.ts +143 -0
  34. package/src/client/orca.d.ts +255 -0
  35. package/src/client/phoenix.d.ts +214 -0
  36. package/src/client/price.d.ts +182 -0
  37. package/src/client/stake-pool.d.ts +39 -0
  38. package/src/client/stake.d.ts +34 -0
  39. package/src/client/state.d.ts +56 -0
  40. package/src/client/timelock.d.ts +31 -0
  41. package/src/client/vault.d.ts +98 -0
  42. package/src/client.d.ts +82 -0
  43. package/src/clientConfig.d.ts +32 -0
  44. package/src/constants.d.ts +111 -0
  45. package/src/deser/base.d.ts +18 -0
  46. package/src/deser/index.d.ts +4 -0
  47. package/src/deser/integrationPolicies.d.ts +195 -0
  48. package/src/deser/kaminoLayouts.d.ts +264 -0
  49. package/src/deser/loopscaleLayouts.d.ts +157 -0
  50. package/src/deser/tokenAclLayouts.d.ts +67 -0
  51. package/src/error.d.ts +29 -0
  52. package/src/glamExports.d.ts +6260 -0
  53. package/src/globalConfig.d.ts +27 -0
  54. package/src/index.d.ts +24 -0
  55. package/src/models/acl.d.ts +43 -0
  56. package/src/models/index.d.ts +8 -0
  57. package/src/models/mint.d.ts +57 -0
  58. package/src/models/state.d.ts +94 -0
  59. package/src/models/types.d.ts +28 -0
  60. package/src/protocols.d.ts +29 -0
  61. package/src/utils/accounts.d.ts +71 -0
  62. package/src/utils/bitmask.d.ts +53 -0
  63. package/src/utils/blockhash.d.ts +11 -0
  64. package/src/utils/common.d.ts +73 -0
  65. package/src/utils/computeBudget.d.ts +15 -0
  66. package/src/utils/evm.d.ts +10 -0
  67. package/src/utils/fraction.d.ts +29 -0
  68. package/src/utils/glamPDAs.d.ts +15 -0
  69. package/src/utils/helius.d.ts +66 -0
  70. package/src/utils/index.d.ts +17 -0
  71. package/src/utils/jupiterApi.d.ts +95 -0
  72. package/src/utils/lookupTables.d.ts +83 -0
  73. package/src/utils/phoenixApi.d.ts +146 -0
  74. package/src/utils/pkmap.d.ts +87 -0
  75. package/src/utils/pkset.d.ts +73 -0
  76. package/src/utils/positionCategorizer.d.ts +38 -0
  77. package/src/utils/rpc.d.ts +18 -0
  78. package/src/utils/timelock.d.ts +52 -0
  79. package/src/utils/transaction.d.ts +13 -0
  80. package/target/idl/ext_bridge-staging.json +2379 -0
  81. package/target/idl/ext_bridge.json +2379 -0
  82. package/target/idl/ext_drift.json +5464 -0
  83. package/target/idl/ext_epi-staging.json +2862 -0
  84. package/target/idl/ext_epi.json +2862 -0
  85. package/target/idl/ext_loopscale-staging.json +4708 -0
  86. package/target/idl/ext_loopscale.json +4708 -0
  87. package/target/idl/ext_marinade-staging.json +1587 -0
  88. package/target/idl/ext_phoenix-staging.json +3525 -0
  89. package/target/idl/ext_phoenix.json +3525 -0
  90. package/target/idl/mock_layerzero_endpoint.json +144 -0
  91. package/target/idl/mock_layerzero_oft.json +155 -0
  92. package/target/idl/mock_wormhole_verify_vaa_shim.json +58 -0
  93. package/target/types/ext_bridge-staging.d.ts +2385 -0
  94. package/target/types/ext_bridge-staging.ts +2385 -0
  95. package/target/types/ext_bridge.d.ts +2385 -0
  96. package/target/types/ext_bridge.ts +2385 -0
  97. package/target/types/ext_cctp-staging.d.ts +1268 -0
  98. package/target/types/ext_cctp.d.ts +1268 -0
  99. package/target/types/ext_drift.d.ts +5470 -0
  100. package/target/types/ext_drift.ts +5470 -0
  101. package/target/types/ext_epi-staging.d.ts +2868 -0
  102. package/target/types/ext_epi-staging.ts +2868 -0
  103. package/target/types/ext_epi.d.ts +2868 -0
  104. package/target/types/ext_epi.ts +2868 -0
  105. package/target/types/ext_jupiter-staging.d.ts +1966 -0
  106. package/target/types/ext_jupiter.d.ts +1966 -0
  107. package/target/types/ext_kamino-staging.d.ts +3433 -0
  108. package/target/types/ext_kamino.d.ts +3433 -0
  109. package/target/types/ext_loopscale-staging.d.ts +4714 -0
  110. package/target/types/ext_loopscale-staging.ts +4714 -0
  111. package/target/types/ext_loopscale.d.ts +4714 -0
  112. package/target/types/ext_loopscale.ts +4714 -0
  113. package/target/types/ext_marinade-staging.d.ts +1593 -0
  114. package/target/types/ext_marinade-staging.ts +1593 -0
  115. package/target/types/ext_marinade.d.ts +1593 -0
  116. package/target/types/ext_orca-staging.d.ts +2829 -0
  117. package/target/types/ext_orca.d.ts +2829 -0
  118. package/target/types/ext_phoenix-staging.d.ts +3531 -0
  119. package/target/types/ext_phoenix-staging.ts +3531 -0
  120. package/target/types/ext_phoenix.d.ts +3531 -0
  121. package/target/types/ext_phoenix.ts +3531 -0
  122. package/target/types/ext_spl-staging.d.ts +1274 -0
  123. package/target/types/ext_spl.d.ts +1274 -0
  124. package/target/types/ext_stake_pool-staging.d.ts +1622 -0
  125. package/target/types/ext_stake_pool.d.ts +1622 -0
  126. package/target/types/glam_config.d.ts +755 -0
  127. package/target/types/glam_mint-staging.d.ts +8802 -0
  128. package/target/types/glam_mint.d.ts +6349 -0
  129. package/target/types/glam_policies.d.ts +477 -0
  130. package/target/types/glam_protocol-staging.d.ts +3362 -0
  131. package/target/types/glam_protocol.d.ts +2783 -0
  132. package/target/types/mock_layerzero_endpoint.d.ts +150 -0
  133. package/target/types/mock_layerzero_endpoint.ts +150 -0
  134. package/target/types/mock_layerzero_oft.d.ts +161 -0
  135. package/target/types/mock_layerzero_oft.ts +161 -0
  136. package/target/types/mock_wormhole_verify_vaa_shim.d.ts +64 -0
  137. package/target/types/mock_wormhole_verify_vaa_shim.ts +64 -0
@@ -0,0 +1,82 @@
1
+ import { GlamClientConfig } from "./clientConfig";
2
+ import { BaseClient } from "./client/base";
3
+ import { JupiterSwapClient } from "./client/jupiter";
4
+ import { MarinadeClient } from "./client/marinade";
5
+ import { VaultClient } from "./client/vault";
6
+ import { StateClient } from "./client/state";
7
+ import { KaminoLendingClient, KaminoFarmClient, KaminoVaultsClient } from "./client/kamino";
8
+ import { InvestClient } from "./client/invest";
9
+ import { PriceClient } from "./client/price";
10
+ import { FeesClient } from "./client/fees";
11
+ import { MintClient } from "./client/mint";
12
+ import { AccessClient } from "./client/access";
13
+ import { TimelockClient } from "./client/timelock";
14
+ import { StakeClient } from "./client/stake";
15
+ import { StakePoolClient } from "./client/stake-pool";
16
+ import { CctpClient } from "./client/cctp";
17
+ import { BridgeClient } from "./client/bridge";
18
+ import { EpiClient } from "./client/epi";
19
+ import { LoopscaleBorrowClient, LoopscaleLendClient, LoopscaleVaultClient } from "./client/loopscale";
20
+ import { PhoenixClient } from "./client/phoenix";
21
+ import { JupiterBorrowClient, JupiterEarnClient } from "./client/jupiter-lend";
22
+ import { OrcaWhirlpoolsClient } from "./client/orca";
23
+ /**
24
+ * Main entrypoint for the GLAM SDK
25
+ *
26
+ * Lazy loads each client/module at first use
27
+ */
28
+ export declare class GlamClient extends BaseClient {
29
+ private _invest?;
30
+ private _jupiterSwap?;
31
+ private _marinade?;
32
+ private _vault?;
33
+ private _price?;
34
+ private _stake?;
35
+ private _stakePool?;
36
+ private _state?;
37
+ private _mint?;
38
+ private _access?;
39
+ private _kaminoLending?;
40
+ private _kaminoFarm?;
41
+ private _kaminoVaults?;
42
+ private _fees?;
43
+ private _timelock?;
44
+ private _cctp?;
45
+ private _bridge?;
46
+ private _epi?;
47
+ private _loopscaleCore?;
48
+ private _loopscaleBorrow?;
49
+ private _loopscaleLend?;
50
+ private _loopscaleVault?;
51
+ private _phoenix?;
52
+ private _jupiterEarn?;
53
+ private _jupiterBorrow?;
54
+ private _orca?;
55
+ constructor(config?: GlamClientConfig);
56
+ get invest(): InvestClient;
57
+ get fees(): FeesClient;
58
+ get jupiterSwap(): JupiterSwapClient;
59
+ get marinade(): MarinadeClient;
60
+ get vault(): VaultClient;
61
+ get stake(): StakeClient;
62
+ get stakePool(): StakePoolClient;
63
+ get price(): PriceClient;
64
+ get state(): StateClient;
65
+ get access(): AccessClient;
66
+ get mint(): MintClient;
67
+ get kaminoLending(): KaminoLendingClient;
68
+ get kaminoFarm(): KaminoFarmClient;
69
+ get kaminoVaults(): KaminoVaultsClient;
70
+ get timelock(): TimelockClient;
71
+ get cctp(): CctpClient;
72
+ get bridge(): BridgeClient;
73
+ get epi(): EpiClient;
74
+ private get loopscaleCore();
75
+ get loopscaleBorrow(): LoopscaleBorrowClient;
76
+ get loopscaleLend(): LoopscaleLendClient;
77
+ get loopscaleVault(): LoopscaleVaultClient;
78
+ get phoenix(): PhoenixClient;
79
+ get jupiterEarn(): JupiterEarnClient;
80
+ get jupiterBorrow(): JupiterBorrowClient;
81
+ get orca(): OrcaWhirlpoolsClient;
82
+ }
@@ -0,0 +1,32 @@
1
+ import { Provider, Wallet } from "@coral-xyz/anchor";
2
+ import { PublicKey } from "@solana/web3.js";
3
+ import { JupiterApiClient } from "./utils";
4
+ import { PhoenixApiClient } from "./utils/phoenixApi";
5
+ export declare enum ClusterNetwork {
6
+ Mainnet = "mainnet-beta",
7
+ Testnet = "testnet",
8
+ Devnet = "devnet",
9
+ Localnet = "localnet",
10
+ Custom = "custom"
11
+ }
12
+ export declare namespace ClusterNetwork {
13
+ function fromStr(cluster: string): ClusterNetwork;
14
+ /**
15
+ * Detects the Solana cluster network from an RPC endpoint URL
16
+ *
17
+ * @param rpcUrl The RPC endpoint URL
18
+ * @returns The detected cluster network
19
+ */
20
+ function fromUrl(rpcUrl: string): ClusterNetwork;
21
+ }
22
+ export type GlamClientConfig = {
23
+ provider?: Provider;
24
+ wallet?: Wallet;
25
+ cluster?: ClusterNetwork;
26
+ statePda?: PublicKey;
27
+ jupiterApiKey?: string;
28
+ jupiterApiClient?: JupiterApiClient;
29
+ phoenixApiUrl?: string;
30
+ phoenixApiClient?: PhoenixApiClient;
31
+ useStaging?: boolean;
32
+ };
@@ -0,0 +1,111 @@
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_WORMHOLE_OBSERVATION_CONFIG = "wormhole-observation-config";
14
+ export declare const SEED_WORMHOLE_HYPERLIQUID_OBSERVATION_CONFIG = "wormhole-hl-observation-config";
15
+ export declare const SEED_BRIDGE_REGISTRY = "bridge-registry";
16
+ export declare const SEED_BRIDGE_SESSION = "bridge-session";
17
+ export declare const SEED_BRIDGE_TRANSFER_RECORD = "bridge-transfer-record";
18
+ export declare const STAKE_ACCOUNT_SIZE = 200;
19
+ export declare const METEORA_POSITION_SIZE = 8120;
20
+ export declare const KAMINO_OBTRIGATION_SIZE = 3344;
21
+ export declare const KAMINO_RESERVE_SIZE = 8624;
22
+ export declare const KAMINO_VAULT_STATE_SIZE = 62552;
23
+ export declare const JITO_TIP_DEFAULT: PublicKey;
24
+ export declare const MARINADE_NATIVE_STAKE_AUTHORITY: PublicKey;
25
+ /**
26
+ * Token mints. If no devnet version is defined, assume mainnet and devnet addresses are the same.
27
+ *
28
+ * Unless otherwise noted, all mints have 9 decimals.
29
+ */
30
+ export declare const WSOL: PublicKey;
31
+ export declare const MSOL: PublicKey;
32
+ export declare const USDC: PublicKey;
33
+ export declare const USDC_DEVNET: PublicKey;
34
+ export declare const USDT: PublicKey;
35
+ export declare const JUP: PublicKey;
36
+ /**
37
+ * Program IDs
38
+ */
39
+ export declare const MARINADE_PROGRAM_ID: PublicKey;
40
+ export declare const JUPITER_PROGRAM_ID: PublicKey;
41
+ export declare const SANCTUM_STAKE_POOL_PROGRAM_ID: PublicKey;
42
+ export declare const KAMINO_LENDING_PROGRAM: PublicKey;
43
+ export declare const KAMINO_VAULTS_PROGRAM: PublicKey;
44
+ export declare const KAMINO_FARM_PROGRAM: PublicKey;
45
+ export declare const MEMO_PROGRAM: PublicKey;
46
+ export declare const ALT_PROGRAM_ID: PublicKey;
47
+ export declare const TOKEN_MESSENGER_MINTER_V2: PublicKey;
48
+ export declare const MESSAGE_TRANSMITTER_V2: PublicKey;
49
+ export declare const LOOPSCALE_PROGRAM_ID: PublicKey;
50
+ export declare const WORMHOLE_CORE_BRIDGE_PROGRAM: PublicKey;
51
+ export declare const WORMHOLE_VERIFY_VAA_SHIM_PROGRAM: PublicKey;
52
+ export declare const HYPEREVM_NAV_ADAPTER_V2 = "0x8e3d311e3f5814d2b4c1a9fc56d28d379abd1a86";
53
+ export declare const HYPEREVM_NAV_ADAPTER_V2_EMITTER = "0x0000000000000000000000008e3d311e3f5814d2b4c1a9fc56d28d379abd1a86";
54
+ export declare const LOOPSCALE_PROTOCOL_ADMIN_STATE: PublicKey;
55
+ export declare const PHOENIX_PROGRAM_ID: PublicKey;
56
+ export declare const PHOENIX_LOG_AUTHORITY: PublicKey;
57
+ export declare const PHOENIX_GLOBAL_CONFIG: PublicKey;
58
+ export declare const PHOENIX_WITHDRAW_QUEUE: PublicKey;
59
+ export declare const EMBER_PROGRAM_ID: PublicKey;
60
+ /**
61
+ * Phoenix OrderPacketKind discriminants.
62
+ * Mirror `OrderPacketKind` variant order in anchor/deps/phoenix/phoenix.json.
63
+ */
64
+ export declare const PHOENIX_ORDER_PACKET_KIND_POST_ONLY = 0;
65
+ export declare const PHOENIX_ORDER_PACKET_KIND_LIMIT = 1;
66
+ export declare const PHOENIX_ORDER_PACKET_KIND_IMMEDIATE_OR_CANCEL = 2;
67
+ export declare const JUPITER_LENDING_PROGRAM_ID: PublicKey;
68
+ export declare const JUPITER_VAULTS_PROGRAM_ID: PublicKey;
69
+ export declare const JUPITER_LIQUIDITY_PROGRAM_ID: PublicKey;
70
+ export declare const JUPITER_ORACLE_PROGRAM_ID: PublicKey;
71
+ export declare const TOKEN_METADATA_PROGRAM_ID: PublicKey;
72
+ export declare const ORCA_WHIRLPOOLS_PROGRAM_ID: PublicKey;
73
+ export declare const ORCA_POSITION_DISCRIMINATOR: readonly [170, 188, 143, 228, 122, 64, 247, 208];
74
+ export declare const ORCA_WHIRLPOOL_DISCRIMINATOR: readonly [63, 149, 209, 12, 225, 128, 99, 9];
75
+ export declare const ORCA_TICK_ARRAY_DISCRIMINATOR: readonly [69, 97, 189, 190, 110, 7, 66, 187];
76
+ /**
77
+ * Token ACL (sRFC-37)
78
+ */
79
+ export declare const TOKEN_ACL_PROGRAM: PublicKey;
80
+ export declare const TOKEN_ACL_GATE_PROGRAM: PublicKey;
81
+ /**
82
+ * GLAM programs
83
+ */
84
+ export declare const TRANSFER_HOOK_PROGRAM: PublicKey;
85
+ export declare const GLAM_CONFIG_PROGRAM: PublicKey;
86
+ /**
87
+ * Referrers
88
+ */
89
+ export declare const GLAM_REFERRER: PublicKey;
90
+ /**
91
+ * CCTP domain to chain name mapping
92
+ */
93
+ export declare const CCTP_DOMAIN_MAPPING: Record<number, string>;
94
+ /**
95
+ * Get protocol and permission mappings at runtime to ensure correct program IDs based on environment.
96
+ *
97
+ * This method provides the source of truth for protocol and permission mappings and staging status in SDK.
98
+ */
99
+ export declare const getProtocolsAndPermissions: (staging: boolean) => Record<string, Record<string, {
100
+ name: string;
101
+ staging: boolean;
102
+ permissions: Record<number, string>;
103
+ }>>;
104
+ /**
105
+ * (Program ID, Bitflag) -> Protocol Name
106
+ */
107
+ export declare const getProtocolNameByProgramAndBitflag: (staging: boolean) => Record<string, Record<string, string>>;
108
+ /**
109
+ * Protocol Name -> (Program ID, Bitflag)
110
+ */
111
+ export declare const getProgramAndBitflagByProtocolName: (staging: boolean) => Record<string, [string, string]>;
@@ -0,0 +1,18 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ export { Decodable } from "./base";
2
+ export * from "./kaminoLayouts";
3
+ export * from "./loopscaleLayouts";
4
+ export * from "./tokenAclLayouts";
@@ -0,0 +1,195 @@
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 JupiterEarnPolicy {
47
+ mintsAllowlist: PublicKey[];
48
+ static _layout: any;
49
+ constructor(mintsAllowlist: PublicKey[]);
50
+ static decode(buffer: Buffer<ArrayBufferLike>): JupiterEarnPolicy;
51
+ encode(): Buffer;
52
+ }
53
+ export declare class JupiterBorrowPolicy {
54
+ vaultsAllowlist: PublicKey[];
55
+ collateralMintsAllowlist: PublicKey[];
56
+ borrowMintsAllowlist: PublicKey[];
57
+ static _layout: any;
58
+ constructor(vaultsAllowlist: PublicKey[], collateralMintsAllowlist: PublicKey[], borrowMintsAllowlist: PublicKey[]);
59
+ static decode(buffer: Buffer<ArrayBufferLike>): JupiterBorrowPolicy;
60
+ encode(): Buffer;
61
+ }
62
+ export declare class LoopscaleBorrowMarketPolicy {
63
+ market: PublicKey;
64
+ maxBorrowAmount: BN;
65
+ maxTotalBorrowAmount: BN;
66
+ maxLtvBps: number;
67
+ durationIndexesAllowlist: number[];
68
+ static _layout: any;
69
+ constructor(market: PublicKey, maxBorrowAmount: BN, maxTotalBorrowAmount: BN, maxLtvBps: number, durationIndexesAllowlist?: number[]);
70
+ static encodedSize(policy: LoopscaleBorrowMarketPolicy): number;
71
+ }
72
+ export declare class LoopscaleLendingMarketPolicy {
73
+ market: PublicKey;
74
+ maxDepositAmount: BN;
75
+ maxTotalDepositAmount: BN;
76
+ minLoanApyCbps: number;
77
+ maxLtvBps: number;
78
+ durationIndexesAllowlist: number[];
79
+ collateralAssetAllowlist: PublicKey[];
80
+ static _layout: any;
81
+ constructor(market: PublicKey, maxDepositAmount: BN, maxTotalDepositAmount: BN, minLoanApyCbps: number, maxLtvBps: number, durationIndexesAllowlist?: number[], collateralAssetAllowlist?: PublicKey[]);
82
+ static encodedSize(policy: LoopscaleLendingMarketPolicy): number;
83
+ }
84
+ export declare class LoopscaleSellLedgerPolicy {
85
+ maxDiscountBps: number;
86
+ maxSlippageBps: number;
87
+ static _layout: any;
88
+ constructor(maxDiscountBps?: number, maxSlippageBps?: number);
89
+ }
90
+ export declare class LoopscaleBorrowPolicy {
91
+ collateralAllowlist: PublicKey[];
92
+ principalAllowlist: PublicKey[];
93
+ marketPolicies: LoopscaleBorrowMarketPolicy[];
94
+ static _layout: any;
95
+ constructor(collateralAllowlist?: PublicKey[], principalAllowlist?: PublicKey[], marketPolicies?: LoopscaleBorrowMarketPolicy[]);
96
+ static decode(buffer: Buffer<ArrayBufferLike>): LoopscaleBorrowPolicy;
97
+ encode(): Buffer;
98
+ }
99
+ export declare class LoopscaleVaultPolicy {
100
+ vaultAllowlist: PublicKey[];
101
+ static _layout: any;
102
+ constructor(vaultAllowlist?: PublicKey[]);
103
+ static decode(buffer: Buffer<ArrayBufferLike>): LoopscaleVaultPolicy;
104
+ encode(): Buffer;
105
+ }
106
+ export declare class LoopscaleLendingPolicy {
107
+ principalAllowlist: PublicKey[];
108
+ collateralAllowlist: PublicKey[];
109
+ marketPolicies: LoopscaleLendingMarketPolicy[];
110
+ sellLedgerPolicy: LoopscaleSellLedgerPolicy;
111
+ static _layout: any;
112
+ constructor(principalAllowlist?: PublicKey[], collateralAllowlist?: PublicKey[], marketPolicies?: LoopscaleLendingMarketPolicy[], sellLedgerPolicy?: LoopscaleSellLedgerPolicy);
113
+ static decode(buffer: Buffer<ArrayBufferLike>): LoopscaleLendingPolicy;
114
+ encode(): Buffer;
115
+ }
116
+ export declare class PhoenixPolicy {
117
+ marketsAllowlist: PublicKey[];
118
+ allowedOrderTypes: number[];
119
+ requireReduceOnlyOrders: boolean;
120
+ maxPriceDeviationBps: number;
121
+ maxReferencePriceAgeSecs: number;
122
+ constructor(marketsAllowlist: PublicKey[], allowedOrderTypes: number[], requireReduceOnlyOrders: boolean, maxPriceDeviationBps: number, maxReferencePriceAgeSecs?: number);
123
+ static decode(buffer: Buffer<ArrayBufferLike>): PhoenixPolicy;
124
+ encode(): Buffer;
125
+ }
126
+ export declare class WhirlpoolsPolicy {
127
+ whirlpoolsAllowlist: PublicKey[];
128
+ tokenMintsAllowlist: PublicKey[];
129
+ maxDeviationBps: number;
130
+ static _layout: any;
131
+ constructor(whirlpoolsAllowlist: PublicKey[], tokenMintsAllowlist: PublicKey[], maxDeviationBps?: number);
132
+ static decode(buffer: Buffer<ArrayBufferLike>): WhirlpoolsPolicy;
133
+ encode(): Buffer;
134
+ }
135
+ export declare class CctpPolicy {
136
+ allowedDestinations: {
137
+ domain: number;
138
+ address: PublicKey;
139
+ }[];
140
+ static _layout: any;
141
+ constructor(allowedDestinations: {
142
+ domain: number;
143
+ address: PublicKey;
144
+ }[]);
145
+ static decode(buffer: Buffer<ArrayBufferLike>): CctpPolicy;
146
+ encode(): Buffer;
147
+ get domainToAddressesMap(): Map<number, PublicKey[]>;
148
+ }
149
+ export declare enum RouteManagementMode {
150
+ UnmanagedOnly = 0,
151
+ ManagedOnly = 1,
152
+ Either = 2
153
+ }
154
+ export type LayerzeroOftRoute = {
155
+ sourceMint: PublicKey;
156
+ destinationChain: number;
157
+ destinationRecipient: PublicKey;
158
+ providerProgram: PublicKey;
159
+ managementMode: RouteManagementMode;
160
+ minAmount: BN;
161
+ maxAmount: BN;
162
+ };
163
+ export declare class LayerzeroOftPolicy {
164
+ routes: LayerzeroOftRoute[];
165
+ static _layout: any;
166
+ constructor(routes: LayerzeroOftRoute[]);
167
+ static decode(buffer: Buffer<ArrayBufferLike>, _staging?: boolean): LayerzeroOftPolicy;
168
+ encode(): Buffer;
169
+ }
170
+ export declare enum PeriodType {
171
+ Day = 0,
172
+ Week = 1,
173
+ Month = 2
174
+ }
175
+ export interface AssetRateLimit {
176
+ mint: PublicKey;
177
+ periodType: number;
178
+ amount: BN;
179
+ }
180
+ export interface DelegateRateLimit {
181
+ delegate: PublicKey;
182
+ limits: AssetRateLimit[];
183
+ }
184
+ export declare class TransferRateLimitPolicy {
185
+ vaultDefaults: AssetRateLimit[];
186
+ delegateOverrides: DelegateRateLimit[];
187
+ static _layout: any;
188
+ constructor(vaultDefaults: AssetRateLimit[], delegateOverrides: DelegateRateLimit[]);
189
+ static decode(buffer: Buffer<ArrayBufferLike>): TransferRateLimitPolicy;
190
+ encode(): Buffer;
191
+ /**
192
+ * Derive the TransferTracker PDA address for a given vault state, signer, and mint.
193
+ */
194
+ static getTransferTrackerPda(glamState: PublicKey, signer: PublicKey, mint: PublicKey, programId: PublicKey): [PublicKey, number];
195
+ }