@glamsystems/glam-sdk 1.0.12 → 1.0.13-test

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 (110) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1 -1
  3. package/index.cjs.js +1 -57320
  4. package/index.esm.js +1 -57081
  5. package/package.json +26 -15
  6. package/src/assets.d.ts +10 -17
  7. package/src/client/access.d.ts +13 -0
  8. package/src/client/base.d.ts +30 -7
  9. package/src/client/bridge.d.ts +183 -0
  10. package/src/client/bridgeRegistry.d.ts +32 -0
  11. package/src/client/epi.d.ts +78 -0
  12. package/src/client/fees.d.ts +4 -0
  13. package/src/client/invest.d.ts +1 -1
  14. package/src/client/jupiter.d.ts +27 -20
  15. package/src/client/loopscale.d.ts +84 -0
  16. package/src/client/mint.d.ts +54 -1
  17. package/src/client/price.d.ts +26 -39
  18. package/src/client.d.ts +9 -5
  19. package/src/constants.d.ts +11 -7
  20. package/src/deser/index.d.ts +1 -1
  21. package/src/deser/integrationPolicies.d.ts +30 -20
  22. package/src/deser/tokenAclLayouts.d.ts +67 -0
  23. package/src/error.d.ts +2 -1
  24. package/src/glamExports.d.ts +1351 -1546
  25. package/src/globalConfig.d.ts +27 -0
  26. package/src/index.d.ts +5 -1
  27. package/src/models/state.d.ts +2 -0
  28. package/src/utils/accounts.d.ts +9 -1
  29. package/src/utils/bitmask.d.ts +3 -0
  30. package/src/utils/common.d.ts +2 -0
  31. package/src/utils/glamPDAs.d.ts +6 -0
  32. package/src/utils/index.d.ts +0 -1
  33. package/src/utils/pkmap.d.ts +23 -18
  34. package/src/utils/positionCategorizer.d.ts +3 -21
  35. package/target/idl/ext_bridge-staging.json +2379 -0
  36. package/target/idl/ext_bridge.json +2379 -0
  37. package/target/idl/ext_cctp.json +1 -1
  38. package/target/idl/ext_drift.json +1613 -142
  39. package/target/idl/ext_epi-staging.json +2169 -0
  40. package/target/idl/ext_epi.json +2169 -0
  41. package/target/idl/ext_kamino-staging.json +1 -1
  42. package/target/idl/ext_kamino.json +109 -1
  43. package/target/idl/{ext_drift-staging.json → ext_loopscale-staging.json} +986 -1438
  44. package/target/idl/ext_loopscale.json +3541 -0
  45. package/target/idl/ext_marinade-staging.json +1587 -0
  46. package/target/idl/ext_spl-staging.json +1 -1
  47. package/target/idl/ext_spl.json +1 -1
  48. package/target/idl/glam_config.json +78 -9
  49. package/target/idl/glam_mint-staging.json +3002 -1244
  50. package/target/idl/glam_mint.json +239 -8
  51. package/target/idl/glam_policies.json +2 -7
  52. package/target/idl/glam_protocol-staging.json +187 -266
  53. package/target/idl/glam_protocol.json +217 -114
  54. package/target/idl/mock_layerzero_endpoint.json +144 -0
  55. package/target/idl/mock_layerzero_oft.json +155 -0
  56. package/target/types/ext_bridge-staging.d.ts +2385 -0
  57. package/target/types/ext_bridge-staging.ts +2385 -0
  58. package/target/types/ext_bridge.d.ts +2385 -0
  59. package/target/types/ext_bridge.ts +2385 -0
  60. package/target/types/ext_cctp.d.ts +1 -1
  61. package/target/types/ext_cctp.ts +1 -1
  62. package/target/types/ext_drift.d.ts +1609 -138
  63. package/target/types/ext_drift.ts +1613 -142
  64. package/target/types/ext_epi-staging.d.ts +2175 -0
  65. package/target/types/ext_epi-staging.ts +2175 -0
  66. package/target/types/ext_epi.d.ts +2175 -0
  67. package/target/types/ext_epi.ts +2175 -0
  68. package/target/types/ext_kamino-staging.d.ts +3433 -0
  69. package/target/types/ext_kamino-staging.ts +1 -1
  70. package/target/types/ext_kamino.d.ts +109 -1
  71. package/target/types/ext_kamino.ts +109 -1
  72. package/target/types/ext_loopscale-staging.d.ts +3547 -0
  73. package/target/types/{ext_drift-staging.ts → ext_loopscale-staging.ts} +988 -1440
  74. package/target/types/ext_loopscale.d.ts +3547 -0
  75. package/target/types/ext_loopscale.ts +3547 -0
  76. package/target/types/ext_marinade-staging.d.ts +1593 -0
  77. package/target/types/ext_marinade-staging.ts +1593 -0
  78. package/target/types/{ext_offchain.d.ts → ext_spl-staging.d.ts} +219 -19
  79. package/target/types/ext_spl-staging.ts +1 -1
  80. package/target/types/ext_spl.d.ts +1 -1
  81. package/target/types/ext_spl.ts +1 -1
  82. package/target/types/ext_stake_pool-staging.d.ts +1622 -0
  83. package/target/types/glam_config.d.ts +78 -9
  84. package/target/types/glam_config.ts +78 -9
  85. package/target/types/glam_mint-staging.d.ts +7856 -0
  86. package/target/types/glam_mint-staging.ts +3002 -1244
  87. package/target/types/glam_mint.d.ts +239 -8
  88. package/target/types/glam_mint.ts +239 -8
  89. package/target/types/glam_policies.d.ts +477 -0
  90. package/target/types/glam_policies.ts +2 -7
  91. package/target/types/glam_protocol-staging.d.ts +3292 -0
  92. package/target/types/glam_protocol-staging.ts +187 -266
  93. package/target/types/glam_protocol.d.ts +217 -114
  94. package/target/types/glam_protocol.ts +217 -114
  95. package/target/types/mock_layerzero_endpoint.d.ts +150 -0
  96. package/target/types/mock_layerzero_endpoint.ts +150 -0
  97. package/target/types/mock_layerzero_oft.d.ts +161 -0
  98. package/target/types/mock_layerzero_oft.ts +161 -0
  99. package/src/client/drift/index.d.ts +0 -2
  100. package/src/client/drift/protocol-v2.d.ts +0 -93
  101. package/src/client/drift/vaults.d.ts +0 -60
  102. package/src/deser/driftLayouts.d.ts +0 -217
  103. package/src/react/cluster-provider.d.ts +0 -22
  104. package/src/react/glam.d.ts +0 -51
  105. package/src/react/index.d.ts +0 -5
  106. package/src/react/query-keys.d.ts +0 -40
  107. package/src/react/useVaultBalanceSubscription.d.ts +0 -17
  108. package/src/utils/drift/index.d.ts +0 -2
  109. package/src/utils/drift/orderParams.d.ts +0 -28
  110. package/src/utils/drift/types.d.ts +0 -522
@@ -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,18 +4565,33 @@
4542
4565
  },
4543
4566
  {
4544
4567
  "code": 6014,
4568
+ "name": "AmountBelowMinimum",
4569
+ "msg": "Amount is below the minimum required"
4570
+ },
4571
+ {
4572
+ "code": 6015,
4545
4573
  "name": "ManagerFeesNotCrystallized",
4546
4574
  "msg": "Manager fees should be crystallized before updating"
4547
4575
  },
4548
4576
  {
4549
- "code": 6015,
4577
+ "code": 6016,
4578
+ "name": "AmountAboveMaximum",
4579
+ "msg": "Amount exceeds maximum threshold"
4580
+ },
4581
+ {
4582
+ "code": 6017,
4550
4583
  "name": "InsufficientEscrowBalance",
4551
4584
  "msg": "Insufficient escrow balance for fee burn"
4552
4585
  },
4553
4586
  {
4554
- "code": 6016,
4555
- "name": "AmountBelowMinimum",
4556
- "msg": "Amount below minimum threshold"
4587
+ "code": 6018,
4588
+ "name": "TokenAclManagesFreezeThaw",
4589
+ "msg": "Token ACL is enabled; freeze/thaw is managed by the Token ACL program"
4590
+ },
4591
+ {
4592
+ "code": 6019,
4593
+ "name": "InvalidMintState",
4594
+ "msg": "Invalid mint state"
4557
4595
  }
4558
4596
  ],
4559
4597
  "types": [
@@ -4617,6 +4655,51 @@
4617
4655
  ]
4618
4656
  }
4619
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": "i8"
4690
+ },
4691
+ {
4692
+ "name": "padding",
4693
+ "type": {
4694
+ "array": [
4695
+ "u8",
4696
+ 3
4697
+ ]
4698
+ }
4699
+ }
4700
+ ]
4701
+ }
4702
+ },
4620
4703
  {
4621
4704
  "name": "AumRecord",
4622
4705
  "type": {
@@ -5071,6 +5154,62 @@
5071
5154
  ]
5072
5155
  }
5073
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
+ "docs": [
5179
+ "Default GLAM referrer"
5180
+ ],
5181
+ "type": "pubkey"
5182
+ },
5183
+ {
5184
+ "name": "base_fee_bps",
5185
+ "docs": [
5186
+ "Default protocol base fee applied to all vaults"
5187
+ ],
5188
+ "type": "u16"
5189
+ },
5190
+ {
5191
+ "name": "flow_fee_bps",
5192
+ "docs": [
5193
+ "Default protocol flow fee applied to all vaults"
5194
+ ],
5195
+ "type": "u16"
5196
+ },
5197
+ {
5198
+ "name": "asset_metas",
5199
+ "docs": [
5200
+ "List of assets and their oracle configs supported by the protocol"
5201
+ ],
5202
+ "type": {
5203
+ "vec": {
5204
+ "defined": {
5205
+ "name": "AssetMeta"
5206
+ }
5207
+ }
5208
+ }
5209
+ }
5210
+ ]
5211
+ }
5212
+ },
5074
5213
  {
5075
5214
  "name": "HurdleType",
5076
5215
  "type": {
@@ -5427,6 +5566,83 @@
5427
5566
  ]
5428
5567
  }
5429
5568
  },
5569
+ {
5570
+ "name": "OracleSource",
5571
+ "type": {
5572
+ "kind": "enum",
5573
+ "variants": [
5574
+ {
5575
+ "name": "Pyth"
5576
+ },
5577
+ {
5578
+ "name": "Switchboard"
5579
+ },
5580
+ {
5581
+ "name": "QuoteAsset"
5582
+ },
5583
+ {
5584
+ "name": "Pyth1K"
5585
+ },
5586
+ {
5587
+ "name": "Pyth1M"
5588
+ },
5589
+ {
5590
+ "name": "PythStableCoin"
5591
+ },
5592
+ {
5593
+ "name": "Prelaunch"
5594
+ },
5595
+ {
5596
+ "name": "PythPull"
5597
+ },
5598
+ {
5599
+ "name": "Pyth1KPull"
5600
+ },
5601
+ {
5602
+ "name": "Pyth1MPull"
5603
+ },
5604
+ {
5605
+ "name": "PythStableCoinPull"
5606
+ },
5607
+ {
5608
+ "name": "SwitchboardOnDemand"
5609
+ },
5610
+ {
5611
+ "name": "PythLazer"
5612
+ },
5613
+ {
5614
+ "name": "PythLazer1K"
5615
+ },
5616
+ {
5617
+ "name": "PythLazer1M"
5618
+ },
5619
+ {
5620
+ "name": "PythLazerStableCoin"
5621
+ },
5622
+ {
5623
+ "name": "NotSet"
5624
+ },
5625
+ {
5626
+ "name": "LstPoolState"
5627
+ },
5628
+ {
5629
+ "name": "MarinadeState"
5630
+ },
5631
+ {
5632
+ "name": "BaseAsset"
5633
+ },
5634
+ {
5635
+ "name": "ChainlinkRWA"
5636
+ },
5637
+ {
5638
+ "name": "ChainlinkX"
5639
+ },
5640
+ {
5641
+ "name": "KaminoReserve"
5642
+ }
5643
+ ]
5644
+ }
5645
+ },
5430
5646
  {
5431
5647
  "name": "PendingRequest",
5432
5648
  "type": {
@@ -5864,6 +6080,21 @@
5864
6080
  "name": "PROTO_MINT_PERM_SET_TOKEN_ACCOUNT_STATE",
5865
6081
  "type": "u64",
5866
6082
  "value": "8"
6083
+ },
6084
+ {
6085
+ "name": "PROTO_MINT_PERM_TOKEN_ACL_APPLY_LIST",
6086
+ "type": "u64",
6087
+ "value": "2048"
6088
+ },
6089
+ {
6090
+ "name": "PROTO_MINT_PERM_TOKEN_ACL_FREEZE_THAW",
6091
+ "type": "u64",
6092
+ "value": "512"
6093
+ },
6094
+ {
6095
+ "name": "PROTO_MINT_PERM_TOKEN_ACL_MANAGE_LIST",
6096
+ "type": "u64",
6097
+ "value": "1024"
5867
6098
  }
5868
6099
  ]
5869
6100
  }
@@ -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": [