@glamsystems/glam-sdk 1.0.13 → 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 (67) hide show
  1. package/README.md +1 -1
  2. package/index.cjs.js +14542 -21898
  3. package/index.esm.js +14521 -21841
  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 +2397 -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
@@ -2,7 +2,7 @@
2
2
  "address": "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh",
3
3
  "metadata": {
4
4
  "name": "glam_mint",
5
- "version": "1.0.2",
5
+ "version": "1.0.3",
6
6
  "spec": "0.1.0",
7
7
  "description": "GLAM mint program"
8
8
  },
@@ -1880,7 +1880,12 @@
1880
1880
  "Extra accounts for pricing N drift users under the same user stats:",
1881
1881
  "- user_stats x 1",
1882
1882
  "- drift_user x N",
1883
- "- markets and oracles used by all drift users (no specific order)"
1883
+ "- markets and oracles used by all drift users (no specific order)",
1884
+ "",
1885
+ "Clients must pre-refresh any stale Drift spot market cumulative interest by",
1886
+ "prepending Drift `update_spot_market_cumulative_interest` instructions for the",
1887
+ "referenced spot markets. Calls will fail with `StaleDriftInterest` if a required",
1888
+ "spot market's cumulative interest is too old."
1884
1889
  ],
1885
1890
  "discriminator": [
1886
1891
  12,
@@ -2115,7 +2120,12 @@
2115
2120
  "- (vault_depositor, drift_vault, drift_user) x N",
2116
2121
  "- spot_market used by drift users of vaults (no specific order)",
2117
2122
  "- perp markets used by drift users of vaults (no specific order)",
2118
- "- oracles of spot markets and perp markets (no specific order)"
2123
+ "- oracles of spot markets and perp markets (no specific order)",
2124
+ "",
2125
+ "Clients must pre-refresh any stale Drift spot market cumulative interest by",
2126
+ "prepending Drift `update_spot_market_cumulative_interest` instructions for the",
2127
+ "referenced spot markets. Calls will fail with `StaleDriftInterest` if a required",
2128
+ "spot market's cumulative interest is too old."
2119
2129
  ],
2120
2130
  "discriminator": [
2121
2131
  234,
@@ -4414,6 +4424,19 @@
4414
4424
  }
4415
4425
  ],
4416
4426
  "accounts": [
4427
+ {
4428
+ "name": "GlobalConfig",
4429
+ "discriminator": [
4430
+ 149,
4431
+ 8,
4432
+ 156,
4433
+ 202,
4434
+ 160,
4435
+ 252,
4436
+ 176,
4437
+ 217
4438
+ ]
4439
+ },
4417
4440
  {
4418
4441
  "name": "RequestQueue",
4419
4442
  "discriminator": [
@@ -4488,7 +4511,7 @@
4488
4511
  {
4489
4512
  "code": 6003,
4490
4513
  "name": "InvalidAsset",
4491
- "msg": "Invalid asset"
4514
+ "msg": "Asset not allowed to subscribe"
4492
4515
  },
4493
4516
  {
4494
4517
  "code": 6004,
@@ -4542,26 +4565,31 @@
4542
4565
  },
4543
4566
  {
4544
4567
  "code": 6014,
4545
- "name": "ManagerFeesNotCrystallized",
4546
- "msg": "Manager fees should be crystallized before updating"
4568
+ "name": "AmountBelowMinimum",
4569
+ "msg": "Amount is below the minimum required"
4547
4570
  },
4548
4571
  {
4549
4572
  "code": 6015,
4550
- "name": "InsufficientEscrowBalance",
4551
- "msg": "Insufficient escrow balance for fee burn"
4573
+ "name": "ManagerFeesNotCrystallized",
4574
+ "msg": "Manager fees should be crystallized before updating"
4552
4575
  },
4553
4576
  {
4554
4577
  "code": 6016,
4555
- "name": "AmountBelowMinimum",
4556
- "msg": "Amount below minimum threshold"
4578
+ "name": "AmountAboveMaximum",
4579
+ "msg": "Amount exceeds maximum threshold"
4557
4580
  },
4558
4581
  {
4559
4582
  "code": 6017,
4583
+ "name": "InsufficientEscrowBalance",
4584
+ "msg": "Insufficient escrow balance for fee burn"
4585
+ },
4586
+ {
4587
+ "code": 6018,
4560
4588
  "name": "TokenAclManagesFreezeThaw",
4561
4589
  "msg": "Token ACL is enabled; freeze/thaw is managed by the Token ACL program"
4562
4590
  },
4563
4591
  {
4564
- "code": 6018,
4592
+ "code": 6019,
4565
4593
  "name": "InvalidMintState",
4566
4594
  "msg": "Invalid mint state"
4567
4595
  }
@@ -4627,6 +4655,51 @@
4627
4655
  ]
4628
4656
  }
4629
4657
  },
4658
+ {
4659
+ "name": "AssetMeta",
4660
+ "type": {
4661
+ "kind": "struct",
4662
+ "fields": [
4663
+ {
4664
+ "name": "asset",
4665
+ "type": "pubkey"
4666
+ },
4667
+ {
4668
+ "name": "decimals",
4669
+ "type": "u8"
4670
+ },
4671
+ {
4672
+ "name": "oracle",
4673
+ "type": "pubkey"
4674
+ },
4675
+ {
4676
+ "name": "oracle_source",
4677
+ "type": {
4678
+ "defined": {
4679
+ "name": "OracleSource"
4680
+ }
4681
+ }
4682
+ },
4683
+ {
4684
+ "name": "max_age_seconds",
4685
+ "type": "u16"
4686
+ },
4687
+ {
4688
+ "name": "priority",
4689
+ "type": "u8"
4690
+ },
4691
+ {
4692
+ "name": "padding",
4693
+ "type": {
4694
+ "array": [
4695
+ "u8",
4696
+ 3
4697
+ ]
4698
+ }
4699
+ }
4700
+ ]
4701
+ }
4702
+ },
4630
4703
  {
4631
4704
  "name": "AumRecord",
4632
4705
  "type": {
@@ -5081,6 +5154,50 @@
5081
5154
  ]
5082
5155
  }
5083
5156
  },
5157
+ {
5158
+ "name": "GlobalConfig",
5159
+ "type": {
5160
+ "kind": "struct",
5161
+ "fields": [
5162
+ {
5163
+ "name": "admin",
5164
+ "docs": [
5165
+ "The authority that can modify the config"
5166
+ ],
5167
+ "type": "pubkey"
5168
+ },
5169
+ {
5170
+ "name": "fee_authority",
5171
+ "docs": [
5172
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
5173
+ ],
5174
+ "type": "pubkey"
5175
+ },
5176
+ {
5177
+ "name": "referrer",
5178
+ "type": "pubkey"
5179
+ },
5180
+ {
5181
+ "name": "base_fee_bps",
5182
+ "type": "u16"
5183
+ },
5184
+ {
5185
+ "name": "flow_fee_bps",
5186
+ "type": "u16"
5187
+ },
5188
+ {
5189
+ "name": "asset_metas",
5190
+ "type": {
5191
+ "vec": {
5192
+ "defined": {
5193
+ "name": "AssetMeta"
5194
+ }
5195
+ }
5196
+ }
5197
+ }
5198
+ ]
5199
+ }
5200
+ },
5084
5201
  {
5085
5202
  "name": "HurdleType",
5086
5203
  "type": {
@@ -5437,6 +5554,83 @@
5437
5554
  ]
5438
5555
  }
5439
5556
  },
5557
+ {
5558
+ "name": "OracleSource",
5559
+ "type": {
5560
+ "kind": "enum",
5561
+ "variants": [
5562
+ {
5563
+ "name": "Pyth"
5564
+ },
5565
+ {
5566
+ "name": "Switchboard"
5567
+ },
5568
+ {
5569
+ "name": "QuoteAsset"
5570
+ },
5571
+ {
5572
+ "name": "Pyth1K"
5573
+ },
5574
+ {
5575
+ "name": "Pyth1M"
5576
+ },
5577
+ {
5578
+ "name": "PythStableCoin"
5579
+ },
5580
+ {
5581
+ "name": "Prelaunch"
5582
+ },
5583
+ {
5584
+ "name": "PythPull"
5585
+ },
5586
+ {
5587
+ "name": "Pyth1KPull"
5588
+ },
5589
+ {
5590
+ "name": "Pyth1MPull"
5591
+ },
5592
+ {
5593
+ "name": "PythStableCoinPull"
5594
+ },
5595
+ {
5596
+ "name": "SwitchboardOnDemand"
5597
+ },
5598
+ {
5599
+ "name": "PythLazer"
5600
+ },
5601
+ {
5602
+ "name": "PythLazer1K"
5603
+ },
5604
+ {
5605
+ "name": "PythLazer1M"
5606
+ },
5607
+ {
5608
+ "name": "PythLazerStableCoin"
5609
+ },
5610
+ {
5611
+ "name": "NotSet"
5612
+ },
5613
+ {
5614
+ "name": "LstPoolState"
5615
+ },
5616
+ {
5617
+ "name": "MarinadeState"
5618
+ },
5619
+ {
5620
+ "name": "BaseAsset"
5621
+ },
5622
+ {
5623
+ "name": "ChainlinkRWA"
5624
+ },
5625
+ {
5626
+ "name": "ChainlinkX"
5627
+ },
5628
+ {
5629
+ "name": "KaminoReserve"
5630
+ }
5631
+ ]
5632
+ }
5633
+ },
5440
5634
  {
5441
5635
  "name": "PendingRequest",
5442
5636
  "type": {
@@ -2,7 +2,7 @@
2
2
  "address": "po1iCYakK3gHCLbuju4wGzFowTMpAJxkqK1iwUqMonY",
3
3
  "metadata": {
4
4
  "name": "glam_policies",
5
- "version": "1.0.0",
5
+ "version": "1.0.1",
6
6
  "spec": "0.1.0",
7
7
  "description": "GLAM policies program"
8
8
  },
@@ -384,12 +384,7 @@
384
384
  {
385
385
  "code": 6002,
386
386
  "name": "NotAuthorized",
387
- "msg": "Signer is not mint authority or permanent delegate"
388
- },
389
- {
390
- "code": 6003,
391
- "name": "MissingPermanentDelegate",
392
- "msg": "Mint has no permanent delegate extension"
387
+ "msg": "Not authorized"
393
388
  }
394
389
  ],
395
390
  "types": [