@glamsystems/glam-sdk 1.0.13 → 1.0.14-alpha.1

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 (67) hide show
  1. package/README.md +1 -1
  2. package/index.cjs.js +14513 -21874
  3. package/index.esm.js +14492 -21817
  4. package/package.json +2 -2
  5. package/src/assets.d.ts +6 -15
  6. package/src/client/base.d.ts +24 -5
  7. package/src/client/bridge.d.ts +184 -0
  8. package/src/client/bridgeRegistry.d.ts +32 -0
  9. package/src/client/epi.d.ts +78 -0
  10. package/src/client/fees.d.ts +1 -0
  11. package/src/client/jupiter.d.ts +22 -18
  12. package/src/client/price.d.ts +13 -37
  13. package/src/client.d.ts +6 -5
  14. package/src/constants.d.ts +5 -7
  15. package/src/deser/index.d.ts +0 -1
  16. package/src/deser/integrationPolicies.d.ts +23 -20
  17. package/src/error.d.ts +2 -1
  18. package/src/glamExports.d.ts +2423 -1787
  19. package/src/globalConfig.d.ts +22 -0
  20. package/src/index.d.ts +3 -1
  21. package/src/react/glam.d.ts +0 -4
  22. package/src/react/query-keys.d.ts +1 -3
  23. package/src/utils/accounts.d.ts +4 -1
  24. package/src/utils/common.d.ts +2 -0
  25. package/src/utils/index.d.ts +0 -1
  26. package/src/utils/positionCategorizer.d.ts +3 -21
  27. package/target/idl/ext_cctp.json +1 -1
  28. package/target/idl/ext_kamino-staging.json +1 -1
  29. package/target/idl/ext_kamino.json +109 -1
  30. package/target/idl/ext_spl-staging.json +1 -1
  31. package/target/idl/ext_spl.json +1 -1
  32. package/target/idl/glam_config.json +75 -9
  33. package/target/idl/glam_mint.json +205 -11
  34. package/target/idl/glam_policies.json +2 -7
  35. package/target/idl/glam_protocol-staging.json +118 -522
  36. package/target/idl/glam_protocol.json +204 -121
  37. package/target/types/ext_bridge.d.ts +2398 -0
  38. package/target/types/ext_cctp.d.ts +1 -1
  39. package/target/types/ext_cctp.ts +1 -1
  40. package/target/types/ext_epi.d.ts +2175 -0
  41. package/target/types/ext_kamino-staging.ts +1 -1
  42. package/target/types/ext_kamino.d.ts +109 -1
  43. package/target/types/ext_kamino.ts +109 -1
  44. package/target/types/ext_spl-staging.ts +1 -1
  45. package/target/types/ext_spl.d.ts +1 -1
  46. package/target/types/ext_spl.ts +1 -1
  47. package/target/types/glam_config.d.ts +75 -9
  48. package/target/types/glam_config.ts +75 -9
  49. package/target/types/glam_mint.d.ts +205 -11
  50. package/target/types/glam_mint.ts +205 -11
  51. package/target/types/glam_policies.ts +2 -7
  52. package/target/types/glam_protocol-staging.ts +118 -522
  53. package/target/types/glam_protocol.d.ts +204 -121
  54. package/target/types/glam_protocol.ts +204 -121
  55. package/src/client/drift/index.d.ts +0 -2
  56. package/src/client/drift/protocol-v2.d.ts +0 -130
  57. package/src/client/drift/vaults.d.ts +0 -60
  58. package/src/deser/driftLayouts.d.ts +0 -217
  59. package/src/utils/drift/index.d.ts +0 -2
  60. package/src/utils/drift/orderParams.d.ts +0 -28
  61. package/src/utils/drift/types.d.ts +0 -522
  62. package/target/idl/ext_drift-staging.json +0 -5442
  63. package/target/idl/ext_drift.json +0 -4962
  64. package/target/types/ext_drift-staging.ts +0 -5448
  65. package/target/types/ext_drift.d.ts +0 -4968
  66. package/target/types/ext_drift.ts +0 -4968
  67. package/target/types/ext_offchain.d.ts +0 -1074
@@ -9,12 +9,15 @@ export declare const SEED_ACCOUNT_POLICY = "account-policy";
9
9
  export declare const SEED_EXTRA_ACCOUNT_METAS = "extra-account-metas";
10
10
  export declare const SEED_GLOBAL_CONFIG = "global-config";
11
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";
12
16
  export declare const STAKE_ACCOUNT_SIZE = 200;
13
17
  export declare const METEORA_POSITION_SIZE = 8120;
14
18
  export declare const KAMINO_OBTRIGATION_SIZE = 3344;
15
19
  export declare const KAMINO_RESERVE_SIZE = 8624;
16
20
  export declare const KAMINO_VAULT_STATE_SIZE = 62552;
17
- export declare const DRIFT_VAULT_DEPOSITOR_SIZE = 272;
18
21
  export declare const JITO_TIP_DEFAULT: PublicKey;
19
22
  export declare const MARINADE_NATIVE_STAKE_AUTHORITY: PublicKey;
20
23
  /**
@@ -26,13 +29,12 @@ export declare const WSOL: PublicKey;
26
29
  export declare const MSOL: PublicKey;
27
30
  export declare const USDC: PublicKey;
28
31
  export declare const USDC_DEVNET: PublicKey;
32
+ export declare const USDT: PublicKey;
29
33
  export declare const JUP: PublicKey;
30
34
  /**
31
35
  * Program IDs
32
36
  */
33
37
  export declare const MARINADE_PROGRAM_ID: PublicKey;
34
- export declare const DRIFT_PROGRAM_ID: PublicKey;
35
- export declare const DRIFT_VAULTS_PROGRAM_ID: PublicKey;
36
38
  export declare const JUPITER_PROGRAM_ID: PublicKey;
37
39
  export declare const SANCTUM_STAKE_POOL_PROGRAM_ID: PublicKey;
38
40
  export declare const KAMINO_LENDING_PROGRAM: PublicKey;
@@ -60,10 +62,6 @@ export declare const GLAM_REFERRER: PublicKey;
60
62
  * CCTP domain to chain name mapping
61
63
  */
62
64
  export declare const CCTP_DOMAIN_MAPPING: Record<number, string>;
63
- /**
64
- * Pool ID to lending pool name mapping for Drift Protocol policies
65
- */
66
- export declare const DRIFT_POOL_MAPPING: Record<number, string>;
67
65
  /**
68
66
  * Get protocol and permission mappings at runtime to ensure correct program IDs based on environment.
69
67
  *
@@ -1,4 +1,3 @@
1
1
  export { Decodable } from "./base";
2
- export * from "./driftLayouts";
3
2
  export * from "./kaminoLayouts";
4
3
  export * from "./tokenAclLayouts";
@@ -16,8 +16,8 @@ export declare class MintPolicy {
16
16
  export declare class JupiterSwapPolicy {
17
17
  maxSlippageBps: number;
18
18
  swapAllowlist: PublicKey[] | null;
19
- static _layout: any;
20
- constructor(maxSlippageBps: number, swapAllowlist: PublicKey[] | null);
19
+ maxDeviationBps: number;
20
+ constructor(maxSlippageBps: number, swapAllowlist: PublicKey[] | null, maxDeviationBps?: number);
21
21
  static decode(buffer: Buffer<ArrayBufferLike>): JupiterSwapPolicy;
22
22
  encode(): Buffer;
23
23
  }
@@ -28,24 +28,6 @@ export declare class TransferPolicy {
28
28
  static decode(buffer: Buffer<ArrayBufferLike>): TransferPolicy;
29
29
  encode(): Buffer;
30
30
  }
31
- export declare class DriftVaultsPolicy {
32
- vaultsAllowlist: PublicKey[];
33
- static _layout: any;
34
- constructor(allowlist: PublicKey[]);
35
- static decode(buffer: Buffer<ArrayBufferLike>): DriftVaultsPolicy;
36
- encode(): Buffer;
37
- }
38
- export declare class DriftProtocolPolicy {
39
- spotMarketsAllowlist: number[];
40
- perpMarketsAllowlist: number[];
41
- borrowAllowlist: PublicKey[];
42
- orderPriceToleranceBps: number;
43
- static _layout: any;
44
- static _stagingLayout: any;
45
- constructor(spotMarketsAllowlist: number[], perpMarketsAllowlist: number[], borrowAllowlist: PublicKey[], orderPriceToleranceBps?: number);
46
- static decode(buffer: Buffer<ArrayBufferLike>, staging?: boolean): DriftProtocolPolicy;
47
- encode(staging?: boolean): Buffer;
48
- }
49
31
  export declare class KaminoLendingPolicy {
50
32
  marketsAllowlist: PublicKey[];
51
33
  borrowAllowlist: PublicKey[];
@@ -75,6 +57,27 @@ export declare class CctpPolicy {
75
57
  encode(): Buffer;
76
58
  get domainToAddressesMap(): Map<number, PublicKey[]>;
77
59
  }
60
+ export declare enum RouteManagementMode {
61
+ UnmanagedOnly = 0,
62
+ ManagedOnly = 1,
63
+ Either = 2
64
+ }
65
+ export type LayerzeroOftRoute = {
66
+ sourceMint: PublicKey;
67
+ destinationChain: number;
68
+ destinationRecipient: PublicKey;
69
+ providerProgram: PublicKey;
70
+ managementMode: RouteManagementMode;
71
+ minAmount: BN;
72
+ maxAmount: BN;
73
+ };
74
+ export declare class LayerzeroOftPolicy {
75
+ routes: LayerzeroOftRoute[];
76
+ static _layout: any;
77
+ constructor(routes: LayerzeroOftRoute[]);
78
+ static decode(buffer: Buffer<ArrayBufferLike>, _staging?: boolean): LayerzeroOftPolicy;
79
+ encode(): Buffer;
80
+ }
78
81
  export declare enum PeriodType {
79
82
  Day = 0,
80
83
  Week = 1,
package/src/error.d.ts CHANGED
@@ -7,7 +7,8 @@ export declare class GlamError extends Error {
7
7
  }
8
8
  /**
9
9
  * Extract the program ID that failed from transaction logs.
10
- * Looks for "Program <ID> failed:" log lines.
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.
11
12
  */
12
13
  export declare function extractFailedProgramId(logs?: string[] | null): string | undefined;
13
14
  /**