@glamsystems/glam-sdk 1.0.12 → 1.0.14-alpha.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 (75) hide show
  1. package/README.md +1 -1
  2. package/index.cjs.js +23827 -26772
  3. package/index.esm.js +23795 -26716
  4. package/package.json +2 -2
  5. package/src/assets.d.ts +9 -15
  6. package/src/client/access.d.ts +13 -0
  7. package/src/client/base.d.ts +27 -6
  8. package/src/client/bridge.d.ts +184 -0
  9. package/src/client/bridgeRegistry.d.ts +32 -0
  10. package/src/client/epi.d.ts +78 -0
  11. package/src/client/fees.d.ts +4 -0
  12. package/src/client/invest.d.ts +1 -1
  13. package/src/client/jupiter.d.ts +22 -18
  14. package/src/client/mint.d.ts +54 -1
  15. package/src/client/price.d.ts +13 -37
  16. package/src/client.d.ts +6 -5
  17. package/src/constants.d.ts +10 -7
  18. package/src/deser/index.d.ts +1 -1
  19. package/src/deser/integrationPolicies.d.ts +23 -20
  20. package/src/deser/tokenAclLayouts.d.ts +67 -0
  21. package/src/error.d.ts +2 -1
  22. package/src/glamExports.d.ts +2344 -1758
  23. package/src/globalConfig.d.ts +22 -0
  24. package/src/index.d.ts +4 -1
  25. package/src/react/glam.d.ts +0 -4
  26. package/src/react/query-keys.d.ts +1 -3
  27. package/src/utils/accounts.d.ts +9 -1
  28. package/src/utils/bitmask.d.ts +3 -0
  29. package/src/utils/common.d.ts +2 -0
  30. package/src/utils/glamPDAs.d.ts +5 -0
  31. package/src/utils/index.d.ts +0 -1
  32. package/src/utils/positionCategorizer.d.ts +3 -21
  33. package/target/idl/ext_cctp.json +1 -1
  34. package/target/idl/ext_kamino-staging.json +1 -1
  35. package/target/idl/ext_kamino.json +109 -1
  36. package/target/idl/ext_spl-staging.json +1 -1
  37. package/target/idl/ext_spl.json +1 -1
  38. package/target/idl/glam_config.json +78 -9
  39. package/target/idl/glam_mint-staging.json +865 -0
  40. package/target/idl/glam_mint.json +227 -8
  41. package/target/idl/glam_policies.json +2 -7
  42. package/target/idl/glam_protocol-staging.json +176 -275
  43. package/target/idl/glam_protocol.json +212 -114
  44. package/target/types/ext_bridge.d.ts +2397 -0
  45. package/target/types/ext_cctp.d.ts +1 -1
  46. package/target/types/ext_cctp.ts +1 -1
  47. package/target/types/ext_epi.d.ts +2175 -0
  48. package/target/types/ext_kamino-staging.ts +1 -1
  49. package/target/types/ext_kamino.d.ts +109 -1
  50. package/target/types/ext_kamino.ts +109 -1
  51. package/target/types/ext_spl-staging.ts +1 -1
  52. package/target/types/ext_spl.d.ts +1 -1
  53. package/target/types/ext_spl.ts +1 -1
  54. package/target/types/glam_config.d.ts +78 -9
  55. package/target/types/glam_config.ts +78 -9
  56. package/target/types/glam_mint-staging.ts +865 -0
  57. package/target/types/glam_mint.d.ts +227 -8
  58. package/target/types/glam_mint.ts +227 -8
  59. package/target/types/glam_policies.ts +2 -7
  60. package/target/types/glam_protocol-staging.ts +176 -275
  61. package/target/types/glam_protocol.d.ts +212 -114
  62. package/target/types/glam_protocol.ts +212 -114
  63. package/src/client/drift/index.d.ts +0 -2
  64. package/src/client/drift/protocol-v2.d.ts +0 -93
  65. package/src/client/drift/vaults.d.ts +0 -60
  66. package/src/deser/driftLayouts.d.ts +0 -217
  67. package/src/utils/drift/index.d.ts +0 -2
  68. package/src/utils/drift/orderParams.d.ts +0 -28
  69. package/src/utils/drift/types.d.ts +0 -522
  70. package/target/idl/ext_drift-staging.json +0 -3993
  71. package/target/idl/ext_drift.json +0 -3993
  72. package/target/types/ext_drift-staging.ts +0 -3999
  73. package/target/types/ext_drift.d.ts +0 -3999
  74. package/target/types/ext_drift.ts +0 -3999
  75. package/target/types/ext_offchain.d.ts +0 -1074
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@glamsystems/glam-sdk",
3
- "version": "1.0.12",
3
+ "version": "1.0.14-alpha.0",
4
4
  "description": "TypeScript SDK for the GLAM Protocol",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
7
7
  "homepage": "https://www.glam.systems",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git@github.com:glamsystems/glam-sdk.git"
10
+ "url": "git@github.com:glamsystems/glam-sdk-ts.git"
11
11
  },
12
12
  "keywords": [
13
13
  "glam",
package/src/assets.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { PublicKey } from "@solana/web3.js";
2
- import { ClusterNetwork } from "./clientConfig";
3
2
  export declare const STAKE_POOLS: {
4
3
  name: string;
5
4
  symbol: string;
@@ -8,6 +7,7 @@ export declare const STAKE_POOLS: {
8
7
  logoURI: string;
9
8
  tokenProgram: PublicKey;
10
9
  poolState: PublicKey;
10
+ isMarinade: boolean;
11
11
  }[];
12
12
  export declare const STAKE_POOLS_MAP: Map<string, {
13
13
  name: string;
@@ -17,30 +17,24 @@ export declare const STAKE_POOLS_MAP: Map<string, {
17
17
  logoURI: string;
18
18
  tokenProgram: PublicKey;
19
19
  poolState: PublicKey;
20
+ isMarinade: boolean;
20
21
  }>;
21
22
  /**
22
23
  * Metadata for an asset for pricing
23
24
  */
24
25
  export interface AssetMeta {
26
+ asset: PublicKey;
25
27
  decimals: number;
26
28
  oracle: PublicKey;
27
- programId?: PublicKey;
28
- aggIndex?: number;
29
+ programId: PublicKey;
30
+ oracleSource?: string;
29
31
  }
30
32
  /**
31
- * Asset-Oracle mapping supported by the protocol. This map is a mirror of onchain mapping stored in `global_config` https://solscan.io/account/6avract7PxKqoq6hdmpAgGKgJWoJWdiXPPzzFZ62Hck6
33
+ * Legacy asset metadata snapshot retained for backward compatibility.
32
34
  *
33
- * Note that we use functional prices for LSTs, and the oracle pubkey of a LST asset is the pool state.
35
+ * Runtime consumers should prefer the onchain-backed helpers in `globalConfig.ts`.
36
+ * Note that we use functional prices for LSTs, and the oracle pubkey of a LST
37
+ * asset is the pool state.
34
38
  */
35
39
  export declare const ASSETS_MAINNET: Map<string, AssetMeta>;
36
40
  export declare const ASSETS_TESTS: Map<string, AssetMeta>;
37
- export declare const SOL_ORACLE: PublicKey;
38
- export declare const USDC_ORACLE: PublicKey;
39
- /**
40
- * Get metadata of an asset for pricing
41
- *
42
- * @param assetMint Token mint of the asset
43
- * @param cluster The cluster network (defaults to mainnet)
44
- * @returns Metadata of the asset
45
- */
46
- export declare function getAssetMeta(assetMint: string | PublicKey, cluster?: ClusterNetwork): AssetMeta;
@@ -9,6 +9,10 @@ declare class TxBuilder extends BaseTxBuilder<AccessClient> {
9
9
  enableDisableProtocolsTx(integrationProgram: PublicKey, protocolBitmask: number, setEnabled: boolean, txOptions: TxOptions): Promise<VersionedTransaction>;
10
10
  grantRevokeDelegatePermissionsIx(delegate: PublicKey, integrationProgram: PublicKey, protocolBitflag: number, permissionsBitmask: BN, setGranted: boolean, signer?: PublicKey): Promise<TransactionInstruction>;
11
11
  grantRevokeDelegatePermissionsTx(delegate: PublicKey, integrationProgram: PublicKey, protocolBitflag: number, permissionsBitmask: BN, setGranted: boolean, txOptions: TxOptions): Promise<VersionedTransaction>;
12
+ addAssetsIx(assets: PublicKey[], signer?: PublicKey): Promise<TransactionInstruction>;
13
+ addAssetsTx(assets: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
14
+ deleteAssetsIx(assets: PublicKey[], signer?: PublicKey): Promise<TransactionInstruction>;
15
+ deleteAssetsTx(assets: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
12
16
  setProtocolPolicyIx(integrationProgram: PublicKey, protocolBitflag: number, data: Buffer, glamSigner: PublicKey): Promise<TransactionInstruction>;
13
17
  setProtocolPolicyTx(integrationProgram: PublicKey, protocolBitflag: number, data: Buffer, txOptions: TxOptions): Promise<VersionedTransaction>;
14
18
  }
@@ -16,6 +20,15 @@ export declare class AccessClient {
16
20
  readonly base: BaseClient;
17
21
  txBuilder: TxBuilder;
18
22
  constructor(base: BaseClient);
23
+ /**
24
+ * Add assets to the vault allowlist
25
+ */
26
+ addAssets(assets: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
27
+ /**
28
+ * Delete assets from the vault allowlist.
29
+ * Assets must have zero vault balance (ATA empty or non-existent).
30
+ */
31
+ deleteAssets(assets: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
19
32
  /**
20
33
  * Emergency access update - bypasses timelock for critical access control changes
21
34
  */
@@ -2,11 +2,13 @@ import * as anchor from "@coral-xyz/anchor";
2
2
  import { BN } from "@coral-xyz/anchor";
3
3
  import { Wallet } from "@coral-xyz/anchor";
4
4
  import { AddressLookupTableAccount, Connection, Keypair, PublicKey, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
5
- import { ExtCctpProgram, ExtDriftProgram, ExtKaminoProgram, ExtMarinadeProgram, ExtOffchainProgram, ExtSplProgram, ExtStakePoolProgram, GlamMintProgram, GlamProtocolProgram } from "../glamExports";
5
+ import { ExtBridgeProgram, ExtEpiProgram, ExtCctpProgram, ExtKaminoProgram, ExtMarinadeProgram, ExtSplProgram, ExtStakePoolProgram, GlamMintProgram, GlamProtocolProgram } from "../glamExports";
6
6
  import { ClusterNetwork, GlamClientConfig } from "../clientConfig";
7
+ import type { GlobalConfigAccount } from "../globalConfig";
7
8
  import { RequestQueue, StateAccount, StateModel } from "../models";
8
9
  import { BlockhashWithCache } from "../utils/blockhash";
9
10
  import { JupiterApiClient } from "../utils";
11
+ import { AssetMeta } from "../assets";
10
12
  export type TxOptions = {
11
13
  signer?: PublicKey;
12
14
  computeUnitLimit?: number;
@@ -39,23 +41,27 @@ export declare class BaseClient {
39
41
  private _protocolProgram?;
40
42
  private _mintProgram?;
41
43
  private _extSplProgram?;
42
- private _extDriftProgram?;
43
44
  private _extKaminoProgram?;
44
45
  private _extMarinadeProgram?;
45
46
  private _extStakePoolProgram?;
46
47
  private _extCctpProgram?;
47
- private _extOffchainProgram?;
48
+ private _extBridgeProgram?;
49
+ private _extEpiProgram?;
48
50
  private _statePda?;
51
+ private _globalConfig?;
52
+ private _globalConfigPromise?;
53
+ private _assetMetas?;
54
+ private _assetMetasPromise?;
49
55
  constructor(config?: GlamClientConfig);
50
56
  get protocolProgram(): GlamProtocolProgram;
51
57
  get mintProgram(): GlamMintProgram;
52
58
  get extSplProgram(): ExtSplProgram;
53
- get extDriftProgram(): ExtDriftProgram;
54
59
  get extKaminoProgram(): ExtKaminoProgram;
55
60
  get extMarinadeProgram(): ExtMarinadeProgram;
56
61
  get extStakePoolProgram(): ExtStakePoolProgram;
57
62
  get extCctpProgram(): ExtCctpProgram;
58
- get extOffchainProgram(): ExtOffchainProgram;
63
+ get extBridgeProgram(): ExtBridgeProgram;
64
+ get extEpiProgram(): ExtEpiProgram;
59
65
  get isVaultConnected(): boolean;
60
66
  get statePda(): PublicKey;
61
67
  set statePda(statePda: PublicKey);
@@ -117,8 +123,23 @@ export declare class BaseClient {
117
123
  uiAmount: number;
118
124
  }>;
119
125
  isLockupEnabled(): Promise<boolean>;
126
+ fetchGlobalConfig(options?: {
127
+ refresh?: boolean;
128
+ }): Promise<GlobalConfigAccount>;
129
+ fetchAssetMetas(options?: {
130
+ refresh?: boolean;
131
+ }): Promise<Map<string, AssetMeta>>;
132
+ refreshAssetMetaCache(): Promise<Map<string, AssetMeta>>;
133
+ getAssetMeta(assetMint: string | PublicKey, options?: {
134
+ refresh?: boolean;
135
+ }): Promise<AssetMeta>;
136
+ getSolOracle(options?: {
137
+ refresh?: boolean;
138
+ }): Promise<PublicKey>;
120
139
  fetchStateAccount(statePda?: PublicKey): Promise<StateAccount>;
121
- fetchRequestQueue(requestQueuePda?: PublicKey): Promise<RequestQueue>;
140
+ private getMintProgramIdForStateAccount;
141
+ private getMintProgramForStateAccount;
142
+ fetchRequestQueue(requestQueuePda?: PublicKey, mintProgram?: GlamMintProgram): Promise<RequestQueue>;
122
143
  /**
123
144
  * Builds a StateModel from onchain accounts (state, mint, etc)
124
145
  *
@@ -0,0 +1,184 @@
1
+ import { BN } from "@coral-xyz/anchor";
2
+ import { AccountMeta, Keypair, PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
3
+ import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
4
+ import { LayerzeroOftRouteProfile } from "./bridgeRegistry";
5
+ import { LayerzeroOftPolicy, LayerzeroOftRoute, RouteManagementMode } from "../deser/integrationPolicies";
6
+ type BufferLike32 = Uint8Array | number[] | Buffer;
7
+ type BufferLike = Uint8Array | number[] | Buffer;
8
+ type RouteManagementModeArg = RouteManagementMode | number | {
9
+ unmanagedOnly: Record<string, never>;
10
+ } | {
11
+ managedOnly: Record<string, never>;
12
+ } | {
13
+ either: Record<string, never>;
14
+ };
15
+ export type LayerzeroOftRouteInput = Omit<LayerzeroOftRoute, "managementMode"> & {
16
+ managementMode: RouteManagementModeArg;
17
+ };
18
+ export type OftTransferParams = {
19
+ transferId: BufferLike32;
20
+ sourceMint: PublicKey;
21
+ sourceAmount: BN;
22
+ providerInstructions: TransactionInstruction[];
23
+ providerReceipt: PublicKey;
24
+ sourceTokenAccount?: PublicKey;
25
+ managed?: boolean;
26
+ providerSigners?: Keypair[];
27
+ prepareRemainingAccounts?: AccountMeta[];
28
+ commitRemainingAccounts?: AccountMeta[];
29
+ };
30
+ export type LayerzeroOftSendParams = {
31
+ transferId?: BufferLike32;
32
+ sourceMint: PublicKey;
33
+ sourceAmount: BN;
34
+ destinationChain: number;
35
+ destinationRecipient: PublicKey;
36
+ nativeFee: BN;
37
+ minAmountLd?: BN;
38
+ lzTokenFee?: BN;
39
+ options?: BufferLike;
40
+ composeMsg?: BufferLike | null;
41
+ sourceTokenAccount?: PublicKey;
42
+ nonceAccount?: PublicKey;
43
+ managed?: boolean;
44
+ providerProgram?: PublicKey;
45
+ };
46
+ export declare function deriveLayerzeroNoncePda(endpointProgram: PublicKey, sender: PublicKey, destinationChain: number, destinationRecipient: PublicKey): PublicKey;
47
+ export declare function deriveOftAuxiliaryAccountSeed(glamState: PublicKey, transferId: BufferLike32): Promise<string>;
48
+ export declare function deriveOftAuxiliaryAccount(glamSigner: PublicKey, glamState: PublicKey, transferId: BufferLike32, tokenProgram: PublicKey): Promise<{
49
+ address: PublicKey;
50
+ seed: string;
51
+ }>;
52
+ declare class TxBuilder extends BaseTxBuilder<BridgeClient> {
53
+ addLayerzeroOftRouteIx(route: LayerzeroOftRouteInput, signer?: PublicKey): Promise<TransactionInstruction>;
54
+ updateLayerzeroOftRouteIx(route: LayerzeroOftRouteInput, signer?: PublicKey): Promise<TransactionInstruction>;
55
+ deleteLayerzeroOftRouteIx(route: LayerzeroOftRouteInput, signer?: PublicKey): Promise<TransactionInstruction>;
56
+ buildOftTransferTx(params: OftTransferParams, txOptions?: TxOptions): Promise<{
57
+ tx: VersionedTransaction;
58
+ additionalSigners: Keypair[];
59
+ sessionPda: PublicKey;
60
+ transferRecordPda: PublicKey;
61
+ auxiliaryTokenAccount: PublicKey;
62
+ sourceTokenAccount: PublicKey;
63
+ }>;
64
+ }
65
+ declare class LayerzeroOftBridgeProtocolClient {
66
+ readonly bridge: BridgeClient;
67
+ constructor(bridge: BridgeClient);
68
+ buildSendTx(params: LayerzeroOftSendParams, txOptions?: TxOptions): Promise<{
69
+ auxiliaryTokenAccount: PublicKey;
70
+ nonceAccount: PublicKey;
71
+ routeProfile: LayerzeroOftRouteProfile;
72
+ sendInstruction: TransactionInstruction;
73
+ tx: VersionedTransaction;
74
+ additionalSigners: Keypair[];
75
+ sessionPda: PublicKey;
76
+ transferRecordPda: PublicKey;
77
+ sourceTokenAccount: PublicKey;
78
+ }>;
79
+ send(params: LayerzeroOftSendParams, txOptions?: TxOptions): Promise<TransactionSignature>;
80
+ }
81
+ export declare class BridgeClient {
82
+ readonly base: BaseClient;
83
+ readonly txBuilder: TxBuilder;
84
+ readonly oft: LayerzeroOftBridgeProtocolClient;
85
+ constructor(base: BaseClient);
86
+ getRegistryPda(): PublicKey;
87
+ getSessionPda(transferId: BufferLike32): PublicKey;
88
+ getTransferRecordPda(transferId: BufferLike32): PublicKey;
89
+ getLayerzeroNoncePda(endpointProgram: PublicKey, sender: PublicKey, destinationChain: number, destinationRecipient: PublicKey): PublicKey;
90
+ deriveOftAuxiliaryTokenAccount(transferId: BufferLike32, sourceMint: PublicKey, signer?: PublicKey): Promise<{
91
+ tokenProgram: PublicKey;
92
+ address: PublicKey;
93
+ seed: string;
94
+ }>;
95
+ private resolveLayerzeroOftRouteProfile;
96
+ private resolveLayerzeroOftNonceAccount;
97
+ private materializeLayerzeroOftRemainingAccounts;
98
+ private buildLayerzeroOftInstructionBaseAccounts;
99
+ private buildLayerzeroOftSendInstruction;
100
+ fetchLayerzeroOftPolicy(): Promise<LayerzeroOftPolicy | null>;
101
+ fetchRegistry(): Promise<{
102
+ glamState: PublicKey;
103
+ managedTransferCount: BN;
104
+ bump: number;
105
+ } | null>;
106
+ fetchSession(transferId: BufferLike32): Promise<{
107
+ glamState: PublicKey;
108
+ signer: PublicKey;
109
+ transferId: number[];
110
+ protocol: number;
111
+ managed: boolean;
112
+ sourceMint: PublicKey;
113
+ sourceTokenAccount: PublicKey;
114
+ providerProgram: PublicKey;
115
+ providerConfig: PublicKey;
116
+ providerSender: PublicKey;
117
+ providerDelegate: PublicKey;
118
+ providerReceipt: PublicKey;
119
+ providerInstructionHash: number[];
120
+ providerInstructionCount: number;
121
+ sourceAmount: BN;
122
+ quotedOutAmount: BN;
123
+ initialSourceBalance: BN;
124
+ initialProviderSequence: BN;
125
+ destinationChain: number;
126
+ destinationRecipient: PublicKey;
127
+ quoteExpiresAt: BN;
128
+ preparedSlot: BN;
129
+ bump: number;
130
+ } | null>;
131
+ fetchTransferRecord(transferId: BufferLike32): Promise<{
132
+ glamState: PublicKey;
133
+ transferId: number[];
134
+ protocol: number;
135
+ status: any;
136
+ managed: boolean;
137
+ receiptVerified: boolean;
138
+ sourceMint: PublicKey;
139
+ sourceTokenAccount: PublicKey;
140
+ providerProgram: PublicKey;
141
+ providerConfig: PublicKey;
142
+ sourceAmount: BN;
143
+ quotedOutAmount: BN;
144
+ destinationChain: number;
145
+ destinationRecipient: PublicKey;
146
+ providerTransferId: number[];
147
+ providerEmitter: PublicKey;
148
+ providerSequence: BN;
149
+ committedSlot: BN;
150
+ settledSlot: BN;
151
+ reconciledSlot: BN;
152
+ failureReason: number;
153
+ bump: number;
154
+ }>;
155
+ addLayerzeroOftRoute(route: LayerzeroOftRouteInput, txOptions?: TxOptions): Promise<TransactionSignature>;
156
+ updateLayerzeroOftRoute(route: LayerzeroOftRouteInput, txOptions?: TxOptions): Promise<TransactionSignature>;
157
+ deleteLayerzeroOftRoute(route: LayerzeroOftRouteInput, txOptions?: TxOptions): Promise<TransactionSignature>;
158
+ buildOftTransferTx(params: OftTransferParams, txOptions?: TxOptions): Promise<{
159
+ tx: VersionedTransaction;
160
+ additionalSigners: Keypair[];
161
+ sessionPda: PublicKey;
162
+ transferRecordPda: PublicKey;
163
+ auxiliaryTokenAccount: PublicKey;
164
+ sourceTokenAccount: PublicKey;
165
+ }>;
166
+ buildLayerzeroOftSendTx(params: LayerzeroOftSendParams, txOptions?: TxOptions): Promise<{
167
+ auxiliaryTokenAccount: PublicKey;
168
+ nonceAccount: PublicKey;
169
+ routeProfile: LayerzeroOftRouteProfile;
170
+ sendInstruction: TransactionInstruction;
171
+ tx: VersionedTransaction;
172
+ additionalSigners: Keypair[];
173
+ sessionPda: PublicKey;
174
+ transferRecordPda: PublicKey;
175
+ sourceTokenAccount: PublicKey;
176
+ }>;
177
+ sendOft(params: OftTransferParams, txOptions?: TxOptions): Promise<TransactionSignature>;
178
+ private extendLookupTables;
179
+ settleManagedTransfer(transferId: BufferLike32, txOptions?: TxOptions): Promise<string>;
180
+ reconcileManagedTransfer(transferId: BufferLike32, txOptions?: TxOptions): Promise<string>;
181
+ failManagedTransfer(transferId: BufferLike32, failureReason: number, txOptions?: TxOptions): Promise<string>;
182
+ cleanupTransferRecord(transferId: BufferLike32, txOptions?: TxOptions): Promise<string>;
183
+ }
184
+ export {};
@@ -0,0 +1,32 @@
1
+ import { PublicKey } from "@solana/web3.js";
2
+ import { ClusterNetwork } from "../clientConfig";
3
+ export type RouteAccountPlaceholder = "payer" | "nonce";
4
+ export type SerializableRouteAccountMeta = {
5
+ pubkey?: PublicKey;
6
+ placeholder?: RouteAccountPlaceholder;
7
+ isSigner: boolean;
8
+ isWritable: boolean;
9
+ };
10
+ export type LayerzeroOftRouteProfile = {
11
+ sourceMint: PublicKey;
12
+ destinationChain: number;
13
+ providerProgram: PublicKey;
14
+ providerConfig: PublicKey;
15
+ nonceAccount?: PublicKey;
16
+ peerConfig: PublicKey;
17
+ providerSender: PublicKey;
18
+ enforcedOptions: PublicKey;
19
+ tokenEscrow: PublicKey;
20
+ eventAuthority: PublicKey;
21
+ lookupTables?: PublicKey[];
22
+ defaultOptions?: Uint8Array | number[] | Buffer;
23
+ defaultMinAmountBps?: number;
24
+ remainingAccounts: SerializableRouteAccountMeta[];
25
+ quoteRemainingAccounts?: SerializableRouteAccountMeta[];
26
+ };
27
+ export declare function resolveCanonicalLayerzeroOftRouteProfile(params: {
28
+ sourceMint: PublicKey;
29
+ destinationChain: number;
30
+ cluster: ClusterNetwork;
31
+ providerProgram?: PublicKey;
32
+ }): LayerzeroOftRouteProfile | null;
@@ -0,0 +1,78 @@
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
+ type BufferLike32 = Uint8Array | number[] | Buffer;
5
+ export type EpiDenominationKindInput = {
6
+ usd: Record<string, never>;
7
+ } | {
8
+ mint: Record<string, never>;
9
+ };
10
+ export type EpiDenominationSpecInput = {
11
+ denom: EpiDenominationKindInput;
12
+ mint: PublicKey;
13
+ };
14
+ export type EpiExternalPositionTypeInput = {
15
+ valued: Record<string, never>;
16
+ } | {
17
+ tokenized: Record<string, never>;
18
+ };
19
+ export type EpiExternalSourceTypeInput = {
20
+ trusted: Record<string, never>;
21
+ } | {
22
+ native: Record<string, never>;
23
+ };
24
+ export type EpiNativeCustodyKindInput = {
25
+ splToken: Record<string, never>;
26
+ } | {
27
+ nativeSol: Record<string, never>;
28
+ };
29
+ export type UpsertExternalPositionParams = {
30
+ positionId: BufferLike32;
31
+ positionType: EpiExternalPositionTypeInput;
32
+ sourceType: EpiExternalSourceTypeInput;
33
+ denomination: EpiDenominationSpecInput;
34
+ nativeCustodyAccount?: PublicKey;
35
+ nativeCustodyKind?: EpiNativeCustodyKindInput;
36
+ enabled?: boolean;
37
+ freshnessOverrideSecs?: number;
38
+ submitAllowlist?: PublicKey[];
39
+ validateAllowlist?: PublicKey[];
40
+ configureAllowlist?: PublicKey[];
41
+ };
42
+ export type SubmitExternalObservationParams = {
43
+ positionId: BufferLike32;
44
+ amount: BN;
45
+ denomination: EpiDenominationSpecInput;
46
+ observationTimestamp: BN;
47
+ externalShares?: BN;
48
+ reserved?: Uint8Array | number[] | Buffer;
49
+ };
50
+ declare class TxBuilder extends BaseTxBuilder<EpiClient> {
51
+ upsertExternalPositionIx(params: UpsertExternalPositionParams, signer?: PublicKey): Promise<TransactionInstruction>;
52
+ submitExternalObservationIx(params: SubmitExternalObservationParams, signer?: PublicKey): Promise<TransactionInstruction>;
53
+ validateExternalObservationIx(positionId: BufferLike32, normalizedBaseAssetAmount: BN | null, signer?: PublicKey): Promise<TransactionInstruction>;
54
+ refreshPricedProtocolIx(signer?: PublicKey): Promise<TransactionInstruction>;
55
+ submitExternalObservationTx(params: SubmitExternalObservationParams, txOptions?: TxOptions): Promise<VersionedTransaction>;
56
+ upsertExternalPositionTx(params: UpsertExternalPositionParams, txOptions?: TxOptions): Promise<VersionedTransaction>;
57
+ validateExternalObservationTx(positionId: BufferLike32, normalizedBaseAssetAmount: BN | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
58
+ refreshPricedProtocolTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
59
+ }
60
+ export declare class EpiClient {
61
+ readonly base: BaseClient;
62
+ readonly txBuilder: TxBuilder;
63
+ constructor(base: BaseClient);
64
+ getObservationStatePda(): PublicKey;
65
+ getIntegrationAuthorityPda(): PublicKey;
66
+ fetchObservationState(): Promise<{
67
+ glamState: PublicKey;
68
+ bump: number;
69
+ positionsLen: number;
70
+ reserved: number[];
71
+ positions: any[];
72
+ } | null>;
73
+ submitExternalObservation(params: SubmitExternalObservationParams, txOptions?: TxOptions): Promise<TransactionSignature>;
74
+ upsertExternalPosition(params: UpsertExternalPositionParams, txOptions?: TxOptions): Promise<TransactionSignature>;
75
+ validateExternalObservation(positionId: BufferLike32, normalizedBaseAssetAmount: BN | null, txOptions?: TxOptions): Promise<TransactionSignature>;
76
+ refreshPricedProtocol(txOptions?: TxOptions): Promise<TransactionSignature>;
77
+ }
78
+ export {};
@@ -6,6 +6,8 @@ declare class TxBuilder extends BaseTxBuilder<FeesClient> {
6
6
  crystallizeFeesTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
7
7
  claimFeesIxs(glamSigner: PublicKey): Promise<TransactionInstruction[]>;
8
8
  claimFeesTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
9
+ chargeProtocolFeeIxs(glamSigner: PublicKey, protocolFeeAuthority: PublicKey): Promise<TransactionInstruction[]>;
10
+ chargeProtocolFeeTx(protocolFeeAuthority: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
9
11
  setProtocolFeesIx(baseFeeBps: number, flowFeeBps: number, signer?: PublicKey): Promise<TransactionInstruction>;
10
12
  setProtocolFeesTx(baseFeeBps: number, flowFeeBps: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
11
13
  }
@@ -24,6 +26,8 @@ export declare class FeesClient {
24
26
  getClaimedFees(): Promise<any>;
25
27
  crystallizeFees(txOptions?: TxOptions): Promise<TransactionSignature>;
26
28
  claimFees(txOptions?: TxOptions): Promise<TransactionSignature>;
29
+ chargeProtocolFee(protocolFeeAuthority: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
30
+ setProtocolFeesIx(baseFeeBps: number, flowFeeBps: number, signer?: PublicKey): Promise<TransactionInstruction>;
27
31
  setProtocolFees(baseFeeBps: number, flowFeeBps: number, txOptions?: TxOptions): Promise<TransactionSignature>;
28
32
  }
29
33
  export {};
@@ -13,7 +13,7 @@ declare class TxBuilder extends BaseTxBuilder<InvestClient> {
13
13
  cancelTx(pubkey: PublicKey | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
14
14
  fulfillIx(limit: number | null, signer: PublicKey): Promise<TransactionInstruction>;
15
15
  fulfillTx(limit: number | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
16
- claimIx(user: PublicKey | null, signer: PublicKey): Promise<TransactionInstruction>;
16
+ claimIxs(user: PublicKey | null, signer: PublicKey): Promise<TransactionInstruction[]>;
17
17
  claimTx(user: PublicKey | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
18
18
  }
19
19
  export declare class InvestClient {
@@ -3,22 +3,30 @@ import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTrans
3
3
  import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
4
4
  import { VaultClient } from "./vault";
5
5
  import { JupiterApiClient, JupiterInstruction, QuoteParams, QuoteResponse, SwapInstructions } from "../utils/jupiterApi";
6
+ export type JupiterSwapOptions = {
7
+ quoteParams?: QuoteParams;
8
+ quoteResponse?: QuoteResponse;
9
+ swapInstructions?: SwapInstructions;
10
+ trackingAccount?: PublicKey;
11
+ };
12
+ export type JupiterSwapV2OracleAccounts = {
13
+ solUsdOracle?: PublicKey;
14
+ inputTokenOracle?: PublicKey;
15
+ outputTokenOracle?: PublicKey;
16
+ };
17
+ export type JupiterSwapV2Options = JupiterSwapOptions & {
18
+ skipQuotePriceCheck?: boolean;
19
+ oracleAccounts?: JupiterSwapV2OracleAccounts;
20
+ };
6
21
  declare class TxBuilder extends BaseTxBuilder<JupiterSwapClient> {
22
+ private resolveSwapInstructionContext;
7
23
  /**
8
24
  * Returns the instructions for a Jupiter swap and the lookup tables
9
25
  */
10
- swapIxs(options: {
11
- quoteParams?: QuoteParams;
12
- quoteResponse?: QuoteResponse;
13
- swapInstructions?: SwapInstructions;
14
- trackingAccount?: PublicKey;
15
- }, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey[]]>;
16
- swapTx(options: {
17
- quoteParams?: QuoteParams;
18
- quoteResponse?: QuoteResponse;
19
- swapInstructions?: SwapInstructions;
20
- trackingAccount?: PublicKey;
21
- }, txOptions?: TxOptions): Promise<VersionedTransaction>;
26
+ swapIxs(options: JupiterSwapOptions, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey[]]>;
27
+ swapV2Ixs(options: JupiterSwapV2Options, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey[]]>;
28
+ swapTx(options: JupiterSwapOptions, txOptions?: TxOptions): Promise<VersionedTransaction>;
29
+ swapV2Tx(options: JupiterSwapV2Options, txOptions?: TxOptions): Promise<VersionedTransaction>;
22
30
  getPreInstructions: (signer: PublicKey, inputMint: PublicKey, outputMint: PublicKey, amount: BN, outputTokenProgram?: PublicKey) => Promise<TransactionInstruction[]>;
23
31
  toTransactionInstruction: (ix: JupiterInstruction) => TransactionInstruction;
24
32
  }
@@ -28,11 +36,7 @@ export declare class JupiterSwapClient {
28
36
  readonly txBuilder: TxBuilder;
29
37
  readonly jupApi: JupiterApiClient;
30
38
  constructor(base: BaseClient, vault: VaultClient);
31
- swap(options: {
32
- quoteParams?: QuoteParams;
33
- quoteResponse?: QuoteResponse;
34
- swapInstructions?: SwapInstructions;
35
- trackingAccount?: PublicKey;
36
- }, txOptions?: TxOptions): Promise<TransactionSignature>;
39
+ swap(options: JupiterSwapOptions, txOptions?: TxOptions): Promise<TransactionSignature>;
40
+ swapV2(options: JupiterSwapV2Options, txOptions?: TxOptions): Promise<TransactionSignature>;
37
41
  }
38
42
  export {};
@@ -1,5 +1,5 @@
1
1
  import { BN } from "@coral-xyz/anchor";
2
- import { PublicKey, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
2
+ import { Connection, PublicKey, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
3
3
  import { BaseClient, BaseTxBuilder, TokenAccount, TxOptions } from "./base";
4
4
  import { PriceClient } from "./price";
5
5
  import { MintIdlModel, RequestType, StateAccountType } from "../models";
@@ -22,6 +22,23 @@ export type UpdateMintParams = {
22
22
  allowlist?: PublicKey[];
23
23
  blocklist?: PublicKey[];
24
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;
25
42
  declare class TxBuilder extends BaseTxBuilder<MintClient> {
26
43
  setTokenAccountsStatesIx(tokenAccounts: PublicKey[], frozen: boolean, glamSigner: PublicKey): Promise<TransactionInstruction>;
27
44
  setTokenAccountsStatesTx(tokenAccounts: PublicKey[], frozen: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
@@ -45,6 +62,30 @@ declare class TxBuilder extends BaseTxBuilder<MintClient> {
45
62
  unpauseRedemptionTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
46
63
  closeMintIx(signer?: PublicKey): Promise<TransactionInstruction>;
47
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>;
48
89
  }
49
90
  export declare class MintClient {
50
91
  readonly base: BaseClient;
@@ -69,6 +110,18 @@ export declare class MintClient {
69
110
  burn(from: PublicKey, amount: BN | number, unfreeze?: boolean, txOptions?: TxOptions): Promise<string>;
70
111
  createTokenAccount(owner: PublicKey, setFrozen: boolean, txOptions?: TxOptions): Promise<string>;
71
112
  setTokenAccountsStates(tokenAccounts: PublicKey[], frozen: boolean, txOptions?: TxOptions): Promise<string>;
113
+ enableTokenAcl(gatingProgram?: PublicKey, txOptions?: TxOptions): Promise<string>;
72
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>;
73
126
  }
74
127
  export {};