@glamsystems/glam-sdk 1.0.9 → 1.0.10

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 (46) hide show
  1. package/index.cjs.js +497 -24
  2. package/index.esm.js +497 -24
  3. package/package.json +1 -1
  4. package/src/client/cctp.d.ts +6 -6
  5. package/src/glamExports.d.ts +1 -5
  6. package/src/models/state.d.ts +5 -0
  7. package/src/react/glam.d.ts +1 -1
  8. package/target/idl/ext_cctp.json +3 -0
  9. package/target/idl/ext_drift-staging.json +3 -0
  10. package/target/idl/ext_drift.json +3 -0
  11. package/target/idl/ext_kamino-staging.json +3 -0
  12. package/target/idl/ext_kamino.json +3 -0
  13. package/target/idl/ext_marinade.json +3 -0
  14. package/target/idl/ext_spl-staging.json +3 -0
  15. package/target/idl/ext_spl.json +3 -0
  16. package/target/idl/ext_stake_pool-staging.json +3 -0
  17. package/target/idl/ext_stake_pool.json +3 -0
  18. package/target/idl/glam_config.json +63 -0
  19. package/target/idl/glam_mint-staging.json +178 -2
  20. package/target/idl/glam_mint.json +178 -2
  21. package/target/idl/glam_protocol-staging.json +4 -1
  22. package/target/idl/glam_protocol.json +4 -1
  23. package/target/types/ext_cctp.d.ts +3 -0
  24. package/target/types/ext_cctp.ts +3 -0
  25. package/target/types/ext_drift-staging.ts +3 -0
  26. package/target/types/ext_drift.d.ts +3 -0
  27. package/target/types/ext_drift.ts +3 -0
  28. package/target/types/ext_kamino-staging.ts +3 -0
  29. package/target/types/ext_kamino.d.ts +3 -0
  30. package/target/types/ext_kamino.ts +3 -0
  31. package/target/types/ext_marinade.d.ts +3 -0
  32. package/target/types/ext_marinade.ts +3 -0
  33. package/target/types/ext_spl-staging.ts +3 -0
  34. package/target/types/ext_spl.d.ts +3 -0
  35. package/target/types/ext_spl.ts +3 -0
  36. package/target/types/ext_stake_pool-staging.ts +3 -0
  37. package/target/types/ext_stake_pool.d.ts +3 -0
  38. package/target/types/ext_stake_pool.ts +3 -0
  39. package/target/types/glam_config.d.ts +63 -0
  40. package/target/types/glam_config.ts +63 -0
  41. package/target/types/glam_mint-staging.ts +178 -2
  42. package/target/types/glam_mint.d.ts +178 -2
  43. package/target/types/glam_mint.ts +178 -2
  44. package/target/types/glam_protocol-staging.ts +4 -1
  45. package/target/types/glam_protocol.d.ts +4 -1
  46. package/target/types/glam_protocol.ts +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glamsystems/glam-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "TypeScript SDK for the GLAM Protocol",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
@@ -21,12 +21,12 @@ declare class TxBuilder extends BaseTxBuilder<CctpClient> {
21
21
  * Returns a transaction that calls CCTP's `depositForBurn` instruction that bridges USDC to another chain.
22
22
  * A keypair is generated for the message sent event account, which must be included as a transaction signer.
23
23
  */
24
- bridgeUsdcIx(amount: BN, domain: number, recipient: PublicKey, params: {
24
+ bridgeUsdcIx(amount: BN, domain: number, destinationAddress: PublicKey, params: {
25
25
  maxFee: BN;
26
26
  minFinalityThreshold: number;
27
27
  destinationCaller?: PublicKey;
28
28
  }, glamSigner: PublicKey): Promise<[TransactionInstruction, Keypair]>;
29
- bridgeUsdcTx(amount: BN, domain: number, recipient: PublicKey, params: {
29
+ bridgeUsdcTx(amount: BN, domain: number, destinationAddress: PublicKey, params: {
30
30
  maxFee: BN;
31
31
  minFinalityThreshold: number;
32
32
  destinationCaller?: PublicKey;
@@ -46,11 +46,11 @@ export declare class CctpClient {
46
46
  *
47
47
  * @param amount Amount of USDC to bridge (in smallest units)
48
48
  * @param domain Destination domain (e.g., 0 for Ethereum, 1 for Avalanche)
49
- * @param recipient Recipient address on destination chain
49
+ * @param destinationAddress Destination address on target chain (EVM address as PublicKey)
50
50
  * @param params Additional parameters (maxFee, minFinalityThreshold)
51
51
  * @param txOptions Transaction options
52
52
  */
53
- bridgeUsdc(amount: BN | number, domain: number, recipient: PublicKey, params: {
53
+ bridgeUsdc(amount: BN | number, domain: number, destinationAddress: PublicKey, params: {
54
54
  maxFee: BN;
55
55
  minFinalityThreshold: number;
56
56
  destinationCaller?: PublicKey;
@@ -99,11 +99,11 @@ export declare class CctpClient {
99
99
  tokenMessengerEventAuthority: PublicKey;
100
100
  };
101
101
  /**
102
- * Find all message accounts onchain for a given sender
102
+ * Find all message accounts onchain for a given sender wallet
103
103
  *
104
104
  * TODO: filter by burned token mint
105
105
  */
106
- findV2Messages(sender: PublicKey, options: {
106
+ findV2Messages(senderWallet: PublicKey, options: {
107
107
  commitment?: Commitment;
108
108
  minSlot?: number;
109
109
  }): Promise<PublicKey[]>;
@@ -2291,10 +2291,7 @@ export declare function getGlamMintIdl(): {
2291
2291
  type: string;
2292
2292
  } | {
2293
2293
  name: string;
2294
- type: string;
2295
- docs?: undefined;
2296
- } | {
2297
- name: string;
2294
+ docs: string[];
2298
2295
  type: {
2299
2296
  vec: {
2300
2297
  defined: {
@@ -2302,7 +2299,6 @@ export declare function getGlamMintIdl(): {
2302
2299
  };
2303
2300
  };
2304
2301
  };
2305
- docs?: undefined;
2306
2302
  })[];
2307
2303
  variants?: undefined;
2308
2304
  };
@@ -88,6 +88,9 @@ export declare class StateAccountType {
88
88
  static readonly MINT: {
89
89
  mint: {};
90
90
  };
91
+ static readonly SINGLE_ASSET_VAULT: {
92
+ singleAssetVault: {};
93
+ };
91
94
  static equals(a: StateAccountType, b: StateAccountType): boolean;
92
95
  static from(s: string): {
93
96
  vault: {};
@@ -95,5 +98,7 @@ export declare class StateAccountType {
95
98
  tokenizedVault: {};
96
99
  } | {
97
100
  mint: {};
101
+ } | {
102
+ singleAssetVault: {};
98
103
  };
99
104
  }
@@ -41,7 +41,7 @@ interface GlamStateCache {
41
41
  owner: PublicKey;
42
42
  sparkleKey: string;
43
43
  name: string;
44
- product: "Mint" | "Vault" | "TokenizedVault";
44
+ product: "Mint" | "Vault" | "TokenizedVault" | "SingleAssetVault";
45
45
  }
46
46
  export declare function GlamProvider({ children, }: Readonly<{
47
47
  children: React.ReactNode;
@@ -231,6 +231,9 @@
231
231
  },
232
232
  {
233
233
  "name": "Mint"
234
+ },
235
+ {
236
+ "name": "SingleAssetVault"
234
237
  }
235
238
  ]
236
239
  }
@@ -2585,6 +2585,9 @@
2585
2585
  },
2586
2586
  {
2587
2587
  "name": "Mint"
2588
+ },
2589
+ {
2590
+ "name": "SingleAssetVault"
2588
2591
  }
2589
2592
  ]
2590
2593
  }
@@ -2585,6 +2585,9 @@
2585
2585
  },
2586
2586
  {
2587
2587
  "name": "Mint"
2588
+ },
2589
+ {
2590
+ "name": "SingleAssetVault"
2588
2591
  }
2589
2592
  ]
2590
2593
  }
@@ -2044,6 +2044,9 @@
2044
2044
  },
2045
2045
  {
2046
2046
  "name": "Mint"
2047
+ },
2048
+ {
2049
+ "name": "SingleAssetVault"
2047
2050
  }
2048
2051
  ]
2049
2052
  }
@@ -2044,6 +2044,9 @@
2044
2044
  },
2045
2045
  {
2046
2046
  "name": "Mint"
2047
+ },
2048
+ {
2049
+ "name": "SingleAssetVault"
2047
2050
  }
2048
2051
  ]
2049
2052
  }
@@ -617,6 +617,9 @@
617
617
  },
618
618
  {
619
619
  "name": "Mint"
620
+ },
621
+ {
622
+ "name": "SingleAssetVault"
620
623
  }
621
624
  ]
622
625
  }
@@ -289,6 +289,9 @@
289
289
  },
290
290
  {
291
291
  "name": "Mint"
292
+ },
293
+ {
294
+ "name": "SingleAssetVault"
292
295
  }
293
296
  ]
294
297
  }
@@ -289,6 +289,9 @@
289
289
  },
290
290
  {
291
291
  "name": "Mint"
292
+ },
293
+ {
294
+ "name": "SingleAssetVault"
292
295
  }
293
296
  ]
294
297
  }
@@ -616,6 +616,9 @@
616
616
  },
617
617
  {
618
618
  "name": "Mint"
619
+ },
620
+ {
621
+ "name": "SingleAssetVault"
619
622
  }
620
623
  ]
621
624
  }
@@ -616,6 +616,9 @@
616
616
  },
617
617
  {
618
618
  "name": "Mint"
619
+ },
620
+ {
621
+ "name": "SingleAssetVault"
619
622
  }
620
623
  ]
621
624
  }
@@ -227,6 +227,57 @@
227
227
  }
228
228
  ]
229
229
  },
230
+ {
231
+ "name": "update_fee_authority",
232
+ "discriminator": [
233
+ 31,
234
+ 223,
235
+ 200,
236
+ 21,
237
+ 114,
238
+ 158,
239
+ 65,
240
+ 61
241
+ ],
242
+ "accounts": [
243
+ {
244
+ "name": "global_config",
245
+ "writable": true,
246
+ "pda": {
247
+ "seeds": [
248
+ {
249
+ "kind": "const",
250
+ "value": [
251
+ 103,
252
+ 108,
253
+ 111,
254
+ 98,
255
+ 97,
256
+ 108,
257
+ 45,
258
+ 99,
259
+ 111,
260
+ 110,
261
+ 102,
262
+ 105,
263
+ 103
264
+ ]
265
+ }
266
+ ]
267
+ }
268
+ },
269
+ {
270
+ "name": "fee_authority",
271
+ "signer": true
272
+ }
273
+ ],
274
+ "args": [
275
+ {
276
+ "name": "fee_authority",
277
+ "type": "pubkey"
278
+ }
279
+ ]
280
+ },
230
281
  {
231
282
  "name": "update_protocol_fees",
232
283
  "discriminator": [
@@ -509,18 +560,30 @@
509
560
  },
510
561
  {
511
562
  "name": "referrer",
563
+ "docs": [
564
+ "Default GLAM referrer"
565
+ ],
512
566
  "type": "pubkey"
513
567
  },
514
568
  {
515
569
  "name": "base_fee_bps",
570
+ "docs": [
571
+ "Default protocol base fee applied to all vaults"
572
+ ],
516
573
  "type": "u16"
517
574
  },
518
575
  {
519
576
  "name": "flow_fee_bps",
577
+ "docs": [
578
+ "Default protocol flow fee applied to all vaults"
579
+ ],
520
580
  "type": "u16"
521
581
  },
522
582
  {
523
583
  "name": "asset_metas",
584
+ "docs": [
585
+ "List of assets and their oracle configs supported by the protocol"
586
+ ],
524
587
  "type": {
525
588
  "vec": {
526
589
  "defined": {
@@ -2,7 +2,7 @@
2
2
  "address": "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5",
3
3
  "metadata": {
4
4
  "name": "glam_mint",
5
- "version": "1.0.1",
5
+ "version": "1.0.2",
6
6
  "spec": "0.1.0",
7
7
  "description": "GLAM mint program"
8
8
  },
@@ -2818,6 +2818,167 @@
2818
2818
  }
2819
2819
  ]
2820
2820
  },
2821
+ {
2822
+ "name": "price_single_asset_vault",
2823
+ "docs": [
2824
+ "Prices a single asset vault."
2825
+ ],
2826
+ "discriminator": [
2827
+ 93,
2828
+ 213,
2829
+ 219,
2830
+ 25,
2831
+ 38,
2832
+ 74,
2833
+ 9,
2834
+ 167
2835
+ ],
2836
+ "accounts": [
2837
+ {
2838
+ "name": "glam_state",
2839
+ "writable": true
2840
+ },
2841
+ {
2842
+ "name": "glam_vault",
2843
+ "pda": {
2844
+ "seeds": [
2845
+ {
2846
+ "kind": "const",
2847
+ "value": [
2848
+ 118,
2849
+ 97,
2850
+ 117,
2851
+ 108,
2852
+ 116
2853
+ ]
2854
+ },
2855
+ {
2856
+ "kind": "account",
2857
+ "path": "glam_state"
2858
+ }
2859
+ ],
2860
+ "program": {
2861
+ "kind": "const",
2862
+ "value": [
2863
+ 10,
2864
+ 55,
2865
+ 49,
2866
+ 193,
2867
+ 142,
2868
+ 247,
2869
+ 75,
2870
+ 193,
2871
+ 33,
2872
+ 61,
2873
+ 5,
2874
+ 218,
2875
+ 254,
2876
+ 219,
2877
+ 143,
2878
+ 206,
2879
+ 156,
2880
+ 138,
2881
+ 14,
2882
+ 32,
2883
+ 89,
2884
+ 232,
2885
+ 248,
2886
+ 173,
2887
+ 46,
2888
+ 77,
2889
+ 46,
2890
+ 206,
2891
+ 189,
2892
+ 171,
2893
+ 68,
2894
+ 237
2895
+ ]
2896
+ }
2897
+ }
2898
+ },
2899
+ {
2900
+ "name": "signer",
2901
+ "writable": true,
2902
+ "signer": true
2903
+ },
2904
+ {
2905
+ "name": "base_asset_ata"
2906
+ },
2907
+ {
2908
+ "name": "integration_authority",
2909
+ "pda": {
2910
+ "seeds": [
2911
+ {
2912
+ "kind": "const",
2913
+ "value": [
2914
+ 105,
2915
+ 110,
2916
+ 116,
2917
+ 101,
2918
+ 103,
2919
+ 114,
2920
+ 97,
2921
+ 116,
2922
+ 105,
2923
+ 111,
2924
+ 110,
2925
+ 45,
2926
+ 97,
2927
+ 117,
2928
+ 116,
2929
+ 104,
2930
+ 111,
2931
+ 114,
2932
+ 105,
2933
+ 116,
2934
+ 121
2935
+ ]
2936
+ }
2937
+ ]
2938
+ }
2939
+ },
2940
+ {
2941
+ "name": "glam_protocol",
2942
+ "address": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"
2943
+ },
2944
+ {
2945
+ "name": "event_authority",
2946
+ "optional": true,
2947
+ "pda": {
2948
+ "seeds": [
2949
+ {
2950
+ "kind": "const",
2951
+ "value": [
2952
+ 95,
2953
+ 95,
2954
+ 101,
2955
+ 118,
2956
+ 101,
2957
+ 110,
2958
+ 116,
2959
+ 95,
2960
+ 97,
2961
+ 117,
2962
+ 116,
2963
+ 104,
2964
+ 111,
2965
+ 114,
2966
+ 105,
2967
+ 116,
2968
+ 121
2969
+ ]
2970
+ }
2971
+ ]
2972
+ }
2973
+ },
2974
+ {
2975
+ "name": "event_program",
2976
+ "optional": true,
2977
+ "address": "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5"
2978
+ }
2979
+ ],
2980
+ "args": []
2981
+ },
2821
2982
  {
2822
2983
  "name": "price_stake_accounts",
2823
2984
  "discriminator": [
@@ -4630,6 +4791,9 @@
4630
4791
  },
4631
4792
  {
4632
4793
  "name": "Mint"
4794
+ },
4795
+ {
4796
+ "name": "SingleAssetVault"
4633
4797
  }
4634
4798
  ]
4635
4799
  }
@@ -4705,7 +4869,7 @@
4705
4869
  },
4706
4870
  {
4707
4871
  "name": "priority",
4708
- "type": "u8"
4872
+ "type": "i8"
4709
4873
  },
4710
4874
  {
4711
4875
  "name": "padding",
@@ -5200,18 +5364,30 @@
5200
5364
  },
5201
5365
  {
5202
5366
  "name": "referrer",
5367
+ "docs": [
5368
+ "Default GLAM referrer"
5369
+ ],
5203
5370
  "type": "pubkey"
5204
5371
  },
5205
5372
  {
5206
5373
  "name": "base_fee_bps",
5374
+ "docs": [
5375
+ "Default protocol base fee applied to all vaults"
5376
+ ],
5207
5377
  "type": "u16"
5208
5378
  },
5209
5379
  {
5210
5380
  "name": "flow_fee_bps",
5381
+ "docs": [
5382
+ "Default protocol flow fee applied to all vaults"
5383
+ ],
5211
5384
  "type": "u16"
5212
5385
  },
5213
5386
  {
5214
5387
  "name": "asset_metas",
5388
+ "docs": [
5389
+ "List of assets and their oracle configs supported by the protocol"
5390
+ ],
5215
5391
  "type": {
5216
5392
  "vec": {
5217
5393
  "defined": {