@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
@@ -8,22 +8,22 @@ export type GlamProtocol = {
8
8
  "address": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz",
9
9
  "metadata": {
10
10
  "name": "glamProtocol",
11
- "version": "1.0.3",
11
+ "version": "1.0.4",
12
12
  "spec": "0.1.0",
13
13
  "description": "Glam Protocol"
14
14
  },
15
15
  "instructions": [
16
16
  {
17
- "name": "cancelTimelock",
17
+ "name": "addAssets",
18
18
  "discriminator": [
19
- 158,
20
- 180,
21
- 47,
22
- 81,
23
- 133,
24
- 231,
25
- 168,
26
- 238
19
+ 221,
20
+ 232,
21
+ 106,
22
+ 164,
23
+ 156,
24
+ 75,
25
+ 127,
26
+ 106
27
27
  ],
28
28
  "accounts": [
29
29
  {
@@ -39,82 +39,29 @@ export type GlamProtocol = {
39
39
  "args": []
40
40
  },
41
41
  {
42
- "name": "checkAndUpdateTransferTracker",
42
+ "name": "cancelTimelock",
43
43
  "discriminator": [
44
+ 158,
44
45
  180,
45
- 225,
46
- 201,
47
- 123,
48
- 192,
49
- 30,
50
- 178,
51
- 195
46
+ 47,
47
+ 81,
48
+ 133,
49
+ 231,
50
+ 168,
51
+ 238
52
52
  ],
53
53
  "accounts": [
54
54
  {
55
- "name": "glamState"
55
+ "name": "glamState",
56
+ "writable": true
56
57
  },
57
58
  {
58
59
  "name": "glamSigner",
59
60
  "writable": true,
60
61
  "signer": true
61
- },
62
- {
63
- "name": "transferTracker",
64
- "writable": true,
65
- "pda": {
66
- "seeds": [
67
- {
68
- "kind": "const",
69
- "value": [
70
- 116,
71
- 114,
72
- 97,
73
- 110,
74
- 115,
75
- 102,
76
- 101,
77
- 114,
78
- 45,
79
- 116,
80
- 114,
81
- 97,
82
- 99,
83
- 107,
84
- 101,
85
- 114
86
- ]
87
- },
88
- {
89
- "kind": "account",
90
- "path": "glamState"
91
- },
92
- {
93
- "kind": "account",
94
- "path": "glamSigner"
95
- },
96
- {
97
- "kind": "arg",
98
- "path": "mint"
99
- }
100
- ]
101
- }
102
- },
103
- {
104
- "name": "systemProgram",
105
- "address": "11111111111111111111111111111111"
106
62
  }
107
63
  ],
108
- "args": [
109
- {
110
- "name": "mint",
111
- "type": "pubkey"
112
- },
113
- {
114
- "name": "amount",
115
- "type": "u64"
116
- }
117
- ]
64
+ "args": []
118
65
  },
119
66
  {
120
67
  "name": "closeState",
@@ -243,6 +190,31 @@ export type GlamProtocol = {
243
190
  }
244
191
  ]
245
192
  },
193
+ {
194
+ "name": "deleteAssets",
195
+ "discriminator": [
196
+ 85,
197
+ 141,
198
+ 142,
199
+ 118,
200
+ 39,
201
+ 152,
202
+ 168,
203
+ 188
204
+ ],
205
+ "accounts": [
206
+ {
207
+ "name": "glamState",
208
+ "writable": true
209
+ },
210
+ {
211
+ "name": "glamSigner",
212
+ "writable": true,
213
+ "signer": true
214
+ }
215
+ ],
216
+ "args": []
217
+ },
246
218
  {
247
219
  "name": "emergencyAccessUpdate",
248
220
  "docs": [
@@ -476,6 +448,70 @@ export type GlamProtocol = {
476
448
  243,
477
449
  18
478
450
  ],
451
+ "accounts": [
452
+ {
453
+ "name": "glamState",
454
+ "writable": true
455
+ },
456
+ {
457
+ "name": "glamVault",
458
+ "writable": true,
459
+ "pda": {
460
+ "seeds": [
461
+ {
462
+ "kind": "const",
463
+ "value": [
464
+ 118,
465
+ 97,
466
+ 117,
467
+ 108,
468
+ 116
469
+ ]
470
+ },
471
+ {
472
+ "kind": "account",
473
+ "path": "glamState"
474
+ }
475
+ ]
476
+ }
477
+ },
478
+ {
479
+ "name": "glamSigner",
480
+ "writable": true,
481
+ "signer": true
482
+ },
483
+ {
484
+ "name": "cpiProgram",
485
+ "address": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"
486
+ },
487
+ {
488
+ "name": "inputStakePool",
489
+ "optional": true
490
+ },
491
+ {
492
+ "name": "outputStakePool",
493
+ "optional": true
494
+ }
495
+ ],
496
+ "args": [
497
+ {
498
+ "name": "data",
499
+ "type": "bytes"
500
+ }
501
+ ]
502
+ },
503
+ {
504
+ "name": "jupiterSwapV2",
505
+ "discriminator": [
506
+ 28,
507
+ 155,
508
+ 14,
509
+ 63,
510
+ 87,
511
+ 96,
512
+ 62,
513
+ 221
514
+ ],
479
515
  "accounts": [
480
516
  {
481
517
  "name": "glamState",
@@ -597,6 +633,10 @@ export type GlamProtocol = {
597
633
  }
598
634
  ],
599
635
  "args": [
636
+ {
637
+ "name": "skipQuotePriceCheck",
638
+ "type": "bool"
639
+ },
600
640
  {
601
641
  "name": "data",
602
642
  "type": "bytes"
@@ -774,40 +814,6 @@ export type GlamProtocol = {
774
814
  }
775
815
  ]
776
816
  },
777
- {
778
- "name": "setTransferRateLimitPolicy",
779
- "discriminator": [
780
- 27,
781
- 40,
782
- 234,
783
- 194,
784
- 151,
785
- 218,
786
- 55,
787
- 203
788
- ],
789
- "accounts": [
790
- {
791
- "name": "glamState",
792
- "writable": true
793
- },
794
- {
795
- "name": "glamSigner",
796
- "writable": true,
797
- "signer": true
798
- }
799
- ],
800
- "args": [
801
- {
802
- "name": "policy",
803
- "type": {
804
- "defined": {
805
- "name": "transferRateLimitPolicy"
806
- }
807
- }
808
- }
809
- ]
810
- },
811
817
  {
812
818
  "name": "stakeAuthorize",
813
819
  "discriminator": [
@@ -1663,19 +1669,6 @@ export type GlamProtocol = {
1663
1669
  249,
1664
1670
  103
1665
1671
  ]
1666
- },
1667
- {
1668
- "name": "transferTracker",
1669
- "discriminator": [
1670
- 153,
1671
- 136,
1672
- 2,
1673
- 106,
1674
- 24,
1675
- 146,
1676
- 147,
1677
- 60
1678
- ]
1679
1672
  }
1680
1673
  ],
1681
1674
  "errors": [
@@ -1731,8 +1724,8 @@ export type GlamProtocol = {
1731
1724
  },
1732
1725
  {
1733
1726
  "code": 48010,
1734
- "name": "invalidAccountOwner",
1735
- "msg": "Account owner does not match expected program"
1727
+ "name": "unexpectedProgramOwner",
1728
+ "msg": "Account is owned by an unexpected program"
1736
1729
  },
1737
1730
  {
1738
1731
  "code": 48011,
@@ -1761,8 +1754,8 @@ export type GlamProtocol = {
1761
1754
  },
1762
1755
  {
1763
1756
  "code": 49004,
1764
- "name": "invalidIndex",
1765
- "msg": "Invalid index"
1757
+ "name": "invalidAssetsLen",
1758
+ "msg": "Too many assets: max 100"
1766
1759
  },
1767
1760
  {
1768
1761
  "code": 49005,
@@ -1821,13 +1814,18 @@ export type GlamProtocol = {
1821
1814
  },
1822
1815
  {
1823
1816
  "code": 49016,
1824
- "name": "integrationAclLimitExceeded",
1825
- "msg": "Integration ACL limit exceeded"
1817
+ "name": "staleDriftInterest",
1818
+ "msg": "Drift spot market cumulative interest is stale"
1826
1819
  },
1827
1820
  {
1828
- "code": 49017,
1829
- "name": "delegateAclLimitExceeded",
1830
- "msg": "Delegate ACL limit exceeded"
1821
+ "code": 49018,
1822
+ "name": "assetBalanceNotZero",
1823
+ "msg": "Cannot delete asset: vault token account balance is not zero"
1824
+ },
1825
+ {
1826
+ "code": 49019,
1827
+ "name": "cannotDeleteBaseAsset",
1828
+ "msg": "Cannot delete base asset from allowlist"
1831
1829
  },
1832
1830
  {
1833
1831
  "code": 50000,
@@ -1869,6 +1867,11 @@ export type GlamProtocol = {
1869
1867
  "name": "multipleStakeAccountsDisallowed",
1870
1868
  "msg": "Multiple stake accounts disallowed"
1871
1869
  },
1870
+ {
1871
+ "code": 50008,
1872
+ "name": "maxDeviationExceeded",
1873
+ "msg": "Max deviation exceeded"
1874
+ },
1872
1875
  {
1873
1876
  "code": 51000,
1874
1877
  "name": "invalidAssetPrice",
@@ -1907,7 +1910,7 @@ export type GlamProtocol = {
1907
1910
  {
1908
1911
  "code": 51105,
1909
1912
  "name": "priceDivergenceTooLarge",
1910
- "msg": "Price confidence interval too wide"
1913
+ "msg": "No priced assets found"
1911
1914
  },
1912
1915
  {
1913
1916
  "code": 51106,
@@ -1916,18 +1919,18 @@ export type GlamProtocol = {
1916
1919
  },
1917
1920
  {
1918
1921
  "code": 51107,
1919
- "name": "invalidSharesRebase",
1920
- "msg": "Invalid shares rebase: new base must be greater than current"
1922
+ "name": "mathError",
1923
+ "msg": "Math error"
1921
1924
  },
1922
1925
  {
1923
1926
  "code": 51108,
1924
- "name": "duplicatePosition",
1925
- "msg": "Duplicate position already priced"
1927
+ "name": "typeCastingError",
1928
+ "msg": "Type casting error"
1926
1929
  },
1927
1930
  {
1928
1931
  "code": 51109,
1929
- "name": "unsupportedVaultState",
1930
- "msg": "Vault protocol or pending fee update not supported for pricing"
1932
+ "name": "baseAssetNotSupported",
1933
+ "msg": "Base asset must have 6 decimals."
1931
1934
  },
1932
1935
  {
1933
1936
  "code": 51110,
@@ -1946,14 +1949,24 @@ export type GlamProtocol = {
1946
1949
  },
1947
1950
  {
1948
1951
  "code": 51113,
1949
- "name": "invalidDiscriminator",
1950
- "msg": "Account discriminator does not match expected value"
1952
+ "name": "unexpectedDiscriminator",
1953
+ "msg": "Invalid account: discriminator mismatch"
1951
1954
  },
1952
1955
  {
1953
1956
  "code": 51114,
1954
1957
  "name": "invalidAccountData",
1955
1958
  "msg": "Invalid account data"
1956
1959
  },
1960
+ {
1961
+ "code": 51115,
1962
+ "name": "oraclePriceSuspended",
1963
+ "msg": "Oracle price is suspended"
1964
+ },
1965
+ {
1966
+ "code": 51116,
1967
+ "name": "assetNotInPricingSet",
1968
+ "msg": "Asset not in pricing set"
1969
+ },
1957
1970
  {
1958
1971
  "code": 50100,
1959
1972
  "name": "transferRateLimitExceeded",
@@ -1983,6 +1996,16 @@ export type GlamProtocol = {
1983
1996
  "code": 52003,
1984
1997
  "name": "lockUp",
1985
1998
  "msg": "Policy violation: lock-up has not expired"
1999
+ },
2000
+ {
2001
+ "code": 52004,
2002
+ "name": "policyNotSet",
2003
+ "msg": "Protocol policy not set"
2004
+ },
2005
+ {
2006
+ "code": 52005,
2007
+ "name": "unsupportedOracleSource",
2008
+ "msg": "Oracle source not supported in this context"
1986
2009
  }
1987
2010
  ],
1988
2011
  "types": [
@@ -2072,30 +2095,6 @@ export type GlamProtocol = {
2072
2095
  ]
2073
2096
  }
2074
2097
  },
2075
- {
2076
- "name": "assetRateLimit",
2077
- "type": {
2078
- "kind": "struct",
2079
- "fields": [
2080
- {
2081
- "name": "mint",
2082
- "type": "pubkey"
2083
- },
2084
- {
2085
- "name": "periodType",
2086
- "type": {
2087
- "defined": {
2088
- "name": "periodType"
2089
- }
2090
- }
2091
- },
2092
- {
2093
- "name": "amount",
2094
- "type": "u64"
2095
- }
2096
- ]
2097
- }
2098
- },
2099
2098
  {
2100
2099
  "name": "createdModel",
2101
2100
  "type": {
@@ -2147,28 +2146,6 @@ export type GlamProtocol = {
2147
2146
  ]
2148
2147
  }
2149
2148
  },
2150
- {
2151
- "name": "delegateRateLimit",
2152
- "type": {
2153
- "kind": "struct",
2154
- "fields": [
2155
- {
2156
- "name": "delegate",
2157
- "type": "pubkey"
2158
- },
2159
- {
2160
- "name": "limits",
2161
- "type": {
2162
- "vec": {
2163
- "defined": {
2164
- "name": "assetRateLimit"
2165
- }
2166
- }
2167
- }
2168
- }
2169
- ]
2170
- }
2171
- },
2172
2149
  {
2173
2150
  "name": "emergencyAccessUpdateArgs",
2174
2151
  "type": {
@@ -2677,6 +2654,10 @@ export type GlamProtocol = {
2677
2654
  "vec": "pubkey"
2678
2655
  }
2679
2656
  }
2657
+ },
2658
+ {
2659
+ "name": "maxDeviationBps",
2660
+ "type": "i16"
2680
2661
  }
2681
2662
  ]
2682
2663
  }
@@ -2839,26 +2820,6 @@ export type GlamProtocol = {
2839
2820
  ]
2840
2821
  }
2841
2822
  },
2842
- {
2843
- "name": "periodType",
2844
- "repr": {
2845
- "kind": "rust"
2846
- },
2847
- "type": {
2848
- "kind": "enum",
2849
- "variants": [
2850
- {
2851
- "name": "day"
2852
- },
2853
- {
2854
- "name": "week"
2855
- },
2856
- {
2857
- "name": "month"
2858
- }
2859
- ]
2860
- }
2861
- },
2862
2823
  {
2863
2824
  "name": "pricedProtocol",
2864
2825
  "type": {
@@ -3226,66 +3187,6 @@ export type GlamProtocol = {
3226
3187
  ]
3227
3188
  }
3228
3189
  },
3229
- {
3230
- "name": "transferRateLimitPolicy",
3231
- "type": {
3232
- "kind": "struct",
3233
- "fields": [
3234
- {
3235
- "name": "vaultDefaults",
3236
- "type": {
3237
- "vec": {
3238
- "defined": {
3239
- "name": "assetRateLimit"
3240
- }
3241
- }
3242
- }
3243
- },
3244
- {
3245
- "name": "delegateOverrides",
3246
- "type": {
3247
- "vec": {
3248
- "defined": {
3249
- "name": "delegateRateLimit"
3250
- }
3251
- }
3252
- }
3253
- }
3254
- ]
3255
- }
3256
- },
3257
- {
3258
- "name": "transferTracker",
3259
- "type": {
3260
- "kind": "struct",
3261
- "fields": [
3262
- {
3263
- "name": "vault",
3264
- "type": "pubkey"
3265
- },
3266
- {
3267
- "name": "signer",
3268
- "type": "pubkey"
3269
- },
3270
- {
3271
- "name": "mint",
3272
- "type": "pubkey"
3273
- },
3274
- {
3275
- "name": "periodStart",
3276
- "type": "i64"
3277
- },
3278
- {
3279
- "name": "amountTransferred",
3280
- "type": "u64"
3281
- },
3282
- {
3283
- "name": "bump",
3284
- "type": "u8"
3285
- }
3286
- ]
3287
- }
3288
- },
3289
3190
  {
3290
3191
  "name": "valuationModel",
3291
3192
  "type": {
@@ -3307,6 +3208,16 @@ export type GlamProtocol = {
3307
3208
  "type": "u16",
3308
3209
  "value": "4"
3309
3210
  },
3211
+ {
3212
+ "name": "protoJupiterSwapPermSkipQuotePriceCheck",
3213
+ "type": "u64",
3214
+ "value": "32"
3215
+ },
3216
+ {
3217
+ "name": "protoJupiterSwapPermSkipQuotePriceCheckLimited",
3218
+ "type": "u64",
3219
+ "value": "16"
3220
+ },
3310
3221
  {
3311
3222
  "name": "protoJupiterSwapPermSwapAllowlisted",
3312
3223
  "type": "u64",
@@ -3347,11 +3258,6 @@ export type GlamProtocol = {
3347
3258
  "type": "u16",
3348
3259
  "value": "1"
3349
3260
  },
3350
- {
3351
- "name": "protoSystemPermEmergencyUpdate",
3352
- "type": "u64",
3353
- "value": "4"
3354
- },
3355
3261
  {
3356
3262
  "name": "protoSystemPermTransfer",
3357
3263
  "type": "u64",
@@ -3361,11 +3267,6 @@ export type GlamProtocol = {
3361
3267
  "name": "protoSystemPermWsol",
3362
3268
  "type": "u64",
3363
3269
  "value": "1"
3364
- },
3365
- {
3366
- "name": "protoTransferLimit",
3367
- "type": "u16",
3368
- "value": "8"
3369
3270
  }
3370
3271
  ]
3371
3272
  };