@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
@@ -8,7 +8,7 @@ export type GlamMint = {
8
8
  "address": "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh";
9
9
  "metadata": {
10
10
  "name": "glamMint";
11
- "version": "1.0.2";
11
+ "version": "1.0.3";
12
12
  "spec": "0.1.0";
13
13
  "description": "GLAM mint program";
14
14
  };
@@ -1886,7 +1886,12 @@ export type GlamMint = {
1886
1886
  "Extra accounts for pricing N drift users under the same user stats:",
1887
1887
  "- user_stats x 1",
1888
1888
  "- drift_user x N",
1889
- "- markets and oracles used by all drift users (no specific order)"
1889
+ "- markets and oracles used by all drift users (no specific order)",
1890
+ "",
1891
+ "Clients must pre-refresh any stale Drift spot market cumulative interest by",
1892
+ "prepending Drift `update_spot_market_cumulative_interest` instructions for the",
1893
+ "referenced spot markets. Calls will fail with `StaleDriftInterest` if a required",
1894
+ "spot market's cumulative interest is too old."
1890
1895
  ];
1891
1896
  "discriminator": [
1892
1897
  12,
@@ -2121,7 +2126,12 @@ export type GlamMint = {
2121
2126
  "- (vault_depositor, drift_vault, drift_user) x N",
2122
2127
  "- spot_market used by drift users of vaults (no specific order)",
2123
2128
  "- perp markets used by drift users of vaults (no specific order)",
2124
- "- oracles of spot markets and perp markets (no specific order)"
2129
+ "- oracles of spot markets and perp markets (no specific order)",
2130
+ "",
2131
+ "Clients must pre-refresh any stale Drift spot market cumulative interest by",
2132
+ "prepending Drift `update_spot_market_cumulative_interest` instructions for the",
2133
+ "referenced spot markets. Calls will fail with `StaleDriftInterest` if a required",
2134
+ "spot market's cumulative interest is too old."
2125
2135
  ];
2126
2136
  "discriminator": [
2127
2137
  234,
@@ -4420,6 +4430,19 @@ export type GlamMint = {
4420
4430
  }
4421
4431
  ];
4422
4432
  "accounts": [
4433
+ {
4434
+ "name": "globalConfig";
4435
+ "discriminator": [
4436
+ 149,
4437
+ 8,
4438
+ 156,
4439
+ 202,
4440
+ 160,
4441
+ 252,
4442
+ 176,
4443
+ 217
4444
+ ];
4445
+ },
4423
4446
  {
4424
4447
  "name": "requestQueue";
4425
4448
  "discriminator": [
@@ -4494,7 +4517,7 @@ export type GlamMint = {
4494
4517
  {
4495
4518
  "code": 6003;
4496
4519
  "name": "invalidAsset";
4497
- "msg": "Invalid asset";
4520
+ "msg": "Asset not allowed to subscribe";
4498
4521
  },
4499
4522
  {
4500
4523
  "code": 6004;
@@ -4548,26 +4571,31 @@ export type GlamMint = {
4548
4571
  },
4549
4572
  {
4550
4573
  "code": 6014;
4551
- "name": "managerFeesNotCrystallized";
4552
- "msg": "Manager fees should be crystallized before updating";
4574
+ "name": "amountBelowMinimum";
4575
+ "msg": "Amount is below the minimum required";
4553
4576
  },
4554
4577
  {
4555
4578
  "code": 6015;
4556
- "name": "insufficientEscrowBalance";
4557
- "msg": "Insufficient escrow balance for fee burn";
4579
+ "name": "managerFeesNotCrystallized";
4580
+ "msg": "Manager fees should be crystallized before updating";
4558
4581
  },
4559
4582
  {
4560
4583
  "code": 6016;
4561
- "name": "amountBelowMinimum";
4562
- "msg": "Amount below minimum threshold";
4584
+ "name": "amountAboveMaximum";
4585
+ "msg": "Amount exceeds maximum threshold";
4563
4586
  },
4564
4587
  {
4565
4588
  "code": 6017;
4589
+ "name": "insufficientEscrowBalance";
4590
+ "msg": "Insufficient escrow balance for fee burn";
4591
+ },
4592
+ {
4593
+ "code": 6018;
4566
4594
  "name": "tokenAclManagesFreezeThaw";
4567
4595
  "msg": "Token ACL is enabled; freeze/thaw is managed by the Token ACL program";
4568
4596
  },
4569
4597
  {
4570
- "code": 6018;
4598
+ "code": 6019;
4571
4599
  "name": "invalidMintState";
4572
4600
  "msg": "Invalid mint state";
4573
4601
  }
@@ -4633,6 +4661,51 @@ export type GlamMint = {
4633
4661
  ];
4634
4662
  };
4635
4663
  },
4664
+ {
4665
+ "name": "assetMeta";
4666
+ "type": {
4667
+ "kind": "struct";
4668
+ "fields": [
4669
+ {
4670
+ "name": "asset";
4671
+ "type": "pubkey";
4672
+ },
4673
+ {
4674
+ "name": "decimals";
4675
+ "type": "u8";
4676
+ },
4677
+ {
4678
+ "name": "oracle";
4679
+ "type": "pubkey";
4680
+ },
4681
+ {
4682
+ "name": "oracleSource";
4683
+ "type": {
4684
+ "defined": {
4685
+ "name": "oracleSource";
4686
+ };
4687
+ };
4688
+ },
4689
+ {
4690
+ "name": "maxAgeSeconds";
4691
+ "type": "u16";
4692
+ },
4693
+ {
4694
+ "name": "priority";
4695
+ "type": "u8";
4696
+ },
4697
+ {
4698
+ "name": "padding";
4699
+ "type": {
4700
+ "array": [
4701
+ "u8",
4702
+ 3
4703
+ ];
4704
+ };
4705
+ }
4706
+ ];
4707
+ };
4708
+ },
4636
4709
  {
4637
4710
  "name": "aumRecord";
4638
4711
  "type": {
@@ -5087,6 +5160,50 @@ export type GlamMint = {
5087
5160
  ];
5088
5161
  };
5089
5162
  },
5163
+ {
5164
+ "name": "globalConfig";
5165
+ "type": {
5166
+ "kind": "struct";
5167
+ "fields": [
5168
+ {
5169
+ "name": "admin";
5170
+ "docs": [
5171
+ "The authority that can modify the config"
5172
+ ];
5173
+ "type": "pubkey";
5174
+ },
5175
+ {
5176
+ "name": "feeAuthority";
5177
+ "docs": [
5178
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
5179
+ ];
5180
+ "type": "pubkey";
5181
+ },
5182
+ {
5183
+ "name": "referrer";
5184
+ "type": "pubkey";
5185
+ },
5186
+ {
5187
+ "name": "baseFeeBps";
5188
+ "type": "u16";
5189
+ },
5190
+ {
5191
+ "name": "flowFeeBps";
5192
+ "type": "u16";
5193
+ },
5194
+ {
5195
+ "name": "assetMetas";
5196
+ "type": {
5197
+ "vec": {
5198
+ "defined": {
5199
+ "name": "assetMeta";
5200
+ };
5201
+ };
5202
+ };
5203
+ }
5204
+ ];
5205
+ };
5206
+ },
5090
5207
  {
5091
5208
  "name": "hurdleType";
5092
5209
  "type": {
@@ -5443,6 +5560,83 @@ export type GlamMint = {
5443
5560
  ];
5444
5561
  };
5445
5562
  },
5563
+ {
5564
+ "name": "oracleSource";
5565
+ "type": {
5566
+ "kind": "enum";
5567
+ "variants": [
5568
+ {
5569
+ "name": "pyth";
5570
+ },
5571
+ {
5572
+ "name": "switchboard";
5573
+ },
5574
+ {
5575
+ "name": "quoteAsset";
5576
+ },
5577
+ {
5578
+ "name": "pyth1K";
5579
+ },
5580
+ {
5581
+ "name": "pyth1M";
5582
+ },
5583
+ {
5584
+ "name": "pythStableCoin";
5585
+ },
5586
+ {
5587
+ "name": "prelaunch";
5588
+ },
5589
+ {
5590
+ "name": "pythPull";
5591
+ },
5592
+ {
5593
+ "name": "pyth1KPull";
5594
+ },
5595
+ {
5596
+ "name": "pyth1MPull";
5597
+ },
5598
+ {
5599
+ "name": "pythStableCoinPull";
5600
+ },
5601
+ {
5602
+ "name": "switchboardOnDemand";
5603
+ },
5604
+ {
5605
+ "name": "pythLazer";
5606
+ },
5607
+ {
5608
+ "name": "pythLazer1K";
5609
+ },
5610
+ {
5611
+ "name": "pythLazer1M";
5612
+ },
5613
+ {
5614
+ "name": "pythLazerStableCoin";
5615
+ },
5616
+ {
5617
+ "name": "notSet";
5618
+ },
5619
+ {
5620
+ "name": "lstPoolState";
5621
+ },
5622
+ {
5623
+ "name": "marinadeState";
5624
+ },
5625
+ {
5626
+ "name": "baseAsset";
5627
+ },
5628
+ {
5629
+ "name": "chainlinkRwa";
5630
+ },
5631
+ {
5632
+ "name": "chainlinkX";
5633
+ },
5634
+ {
5635
+ "name": "kaminoReserve";
5636
+ }
5637
+ ];
5638
+ };
5639
+ },
5446
5640
  {
5447
5641
  "name": "pendingRequest";
5448
5642
  "type": {
@@ -8,7 +8,7 @@ export type GlamMint = {
8
8
  "address": "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh",
9
9
  "metadata": {
10
10
  "name": "glamMint",
11
- "version": "1.0.2",
11
+ "version": "1.0.3",
12
12
  "spec": "0.1.0",
13
13
  "description": "GLAM mint program"
14
14
  },
@@ -1886,7 +1886,12 @@ export type GlamMint = {
1886
1886
  "Extra accounts for pricing N drift users under the same user stats:",
1887
1887
  "- user_stats x 1",
1888
1888
  "- drift_user x N",
1889
- "- markets and oracles used by all drift users (no specific order)"
1889
+ "- markets and oracles used by all drift users (no specific order)",
1890
+ "",
1891
+ "Clients must pre-refresh any stale Drift spot market cumulative interest by",
1892
+ "prepending Drift `update_spot_market_cumulative_interest` instructions for the",
1893
+ "referenced spot markets. Calls will fail with `StaleDriftInterest` if a required",
1894
+ "spot market's cumulative interest is too old."
1890
1895
  ],
1891
1896
  "discriminator": [
1892
1897
  12,
@@ -2121,7 +2126,12 @@ export type GlamMint = {
2121
2126
  "- (vault_depositor, drift_vault, drift_user) x N",
2122
2127
  "- spot_market used by drift users of vaults (no specific order)",
2123
2128
  "- perp markets used by drift users of vaults (no specific order)",
2124
- "- oracles of spot markets and perp markets (no specific order)"
2129
+ "- oracles of spot markets and perp markets (no specific order)",
2130
+ "",
2131
+ "Clients must pre-refresh any stale Drift spot market cumulative interest by",
2132
+ "prepending Drift `update_spot_market_cumulative_interest` instructions for the",
2133
+ "referenced spot markets. Calls will fail with `StaleDriftInterest` if a required",
2134
+ "spot market's cumulative interest is too old."
2125
2135
  ],
2126
2136
  "discriminator": [
2127
2137
  234,
@@ -4420,6 +4430,19 @@ export type GlamMint = {
4420
4430
  }
4421
4431
  ],
4422
4432
  "accounts": [
4433
+ {
4434
+ "name": "globalConfig",
4435
+ "discriminator": [
4436
+ 149,
4437
+ 8,
4438
+ 156,
4439
+ 202,
4440
+ 160,
4441
+ 252,
4442
+ 176,
4443
+ 217
4444
+ ]
4445
+ },
4423
4446
  {
4424
4447
  "name": "requestQueue",
4425
4448
  "discriminator": [
@@ -4494,7 +4517,7 @@ export type GlamMint = {
4494
4517
  {
4495
4518
  "code": 6003,
4496
4519
  "name": "invalidAsset",
4497
- "msg": "Invalid asset"
4520
+ "msg": "Asset not allowed to subscribe"
4498
4521
  },
4499
4522
  {
4500
4523
  "code": 6004,
@@ -4548,26 +4571,31 @@ export type GlamMint = {
4548
4571
  },
4549
4572
  {
4550
4573
  "code": 6014,
4551
- "name": "managerFeesNotCrystallized",
4552
- "msg": "Manager fees should be crystallized before updating"
4574
+ "name": "amountBelowMinimum",
4575
+ "msg": "Amount is below the minimum required"
4553
4576
  },
4554
4577
  {
4555
4578
  "code": 6015,
4556
- "name": "insufficientEscrowBalance",
4557
- "msg": "Insufficient escrow balance for fee burn"
4579
+ "name": "managerFeesNotCrystallized",
4580
+ "msg": "Manager fees should be crystallized before updating"
4558
4581
  },
4559
4582
  {
4560
4583
  "code": 6016,
4561
- "name": "amountBelowMinimum",
4562
- "msg": "Amount below minimum threshold"
4584
+ "name": "amountAboveMaximum",
4585
+ "msg": "Amount exceeds maximum threshold"
4563
4586
  },
4564
4587
  {
4565
4588
  "code": 6017,
4589
+ "name": "insufficientEscrowBalance",
4590
+ "msg": "Insufficient escrow balance for fee burn"
4591
+ },
4592
+ {
4593
+ "code": 6018,
4566
4594
  "name": "tokenAclManagesFreezeThaw",
4567
4595
  "msg": "Token ACL is enabled; freeze/thaw is managed by the Token ACL program"
4568
4596
  },
4569
4597
  {
4570
- "code": 6018,
4598
+ "code": 6019,
4571
4599
  "name": "invalidMintState",
4572
4600
  "msg": "Invalid mint state"
4573
4601
  }
@@ -4633,6 +4661,51 @@ export type GlamMint = {
4633
4661
  ]
4634
4662
  }
4635
4663
  },
4664
+ {
4665
+ "name": "assetMeta",
4666
+ "type": {
4667
+ "kind": "struct",
4668
+ "fields": [
4669
+ {
4670
+ "name": "asset",
4671
+ "type": "pubkey"
4672
+ },
4673
+ {
4674
+ "name": "decimals",
4675
+ "type": "u8"
4676
+ },
4677
+ {
4678
+ "name": "oracle",
4679
+ "type": "pubkey"
4680
+ },
4681
+ {
4682
+ "name": "oracleSource",
4683
+ "type": {
4684
+ "defined": {
4685
+ "name": "oracleSource"
4686
+ }
4687
+ }
4688
+ },
4689
+ {
4690
+ "name": "maxAgeSeconds",
4691
+ "type": "u16"
4692
+ },
4693
+ {
4694
+ "name": "priority",
4695
+ "type": "u8"
4696
+ },
4697
+ {
4698
+ "name": "padding",
4699
+ "type": {
4700
+ "array": [
4701
+ "u8",
4702
+ 3
4703
+ ]
4704
+ }
4705
+ }
4706
+ ]
4707
+ }
4708
+ },
4636
4709
  {
4637
4710
  "name": "aumRecord",
4638
4711
  "type": {
@@ -5087,6 +5160,50 @@ export type GlamMint = {
5087
5160
  ]
5088
5161
  }
5089
5162
  },
5163
+ {
5164
+ "name": "globalConfig",
5165
+ "type": {
5166
+ "kind": "struct",
5167
+ "fields": [
5168
+ {
5169
+ "name": "admin",
5170
+ "docs": [
5171
+ "The authority that can modify the config"
5172
+ ],
5173
+ "type": "pubkey"
5174
+ },
5175
+ {
5176
+ "name": "feeAuthority",
5177
+ "docs": [
5178
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
5179
+ ],
5180
+ "type": "pubkey"
5181
+ },
5182
+ {
5183
+ "name": "referrer",
5184
+ "type": "pubkey"
5185
+ },
5186
+ {
5187
+ "name": "baseFeeBps",
5188
+ "type": "u16"
5189
+ },
5190
+ {
5191
+ "name": "flowFeeBps",
5192
+ "type": "u16"
5193
+ },
5194
+ {
5195
+ "name": "assetMetas",
5196
+ "type": {
5197
+ "vec": {
5198
+ "defined": {
5199
+ "name": "assetMeta"
5200
+ }
5201
+ }
5202
+ }
5203
+ }
5204
+ ]
5205
+ }
5206
+ },
5090
5207
  {
5091
5208
  "name": "hurdleType",
5092
5209
  "type": {
@@ -5443,6 +5560,83 @@ export type GlamMint = {
5443
5560
  ]
5444
5561
  }
5445
5562
  },
5563
+ {
5564
+ "name": "oracleSource",
5565
+ "type": {
5566
+ "kind": "enum",
5567
+ "variants": [
5568
+ {
5569
+ "name": "pyth"
5570
+ },
5571
+ {
5572
+ "name": "switchboard"
5573
+ },
5574
+ {
5575
+ "name": "quoteAsset"
5576
+ },
5577
+ {
5578
+ "name": "pyth1K"
5579
+ },
5580
+ {
5581
+ "name": "pyth1M"
5582
+ },
5583
+ {
5584
+ "name": "pythStableCoin"
5585
+ },
5586
+ {
5587
+ "name": "prelaunch"
5588
+ },
5589
+ {
5590
+ "name": "pythPull"
5591
+ },
5592
+ {
5593
+ "name": "pyth1KPull"
5594
+ },
5595
+ {
5596
+ "name": "pyth1MPull"
5597
+ },
5598
+ {
5599
+ "name": "pythStableCoinPull"
5600
+ },
5601
+ {
5602
+ "name": "switchboardOnDemand"
5603
+ },
5604
+ {
5605
+ "name": "pythLazer"
5606
+ },
5607
+ {
5608
+ "name": "pythLazer1K"
5609
+ },
5610
+ {
5611
+ "name": "pythLazer1M"
5612
+ },
5613
+ {
5614
+ "name": "pythLazerStableCoin"
5615
+ },
5616
+ {
5617
+ "name": "notSet"
5618
+ },
5619
+ {
5620
+ "name": "lstPoolState"
5621
+ },
5622
+ {
5623
+ "name": "marinadeState"
5624
+ },
5625
+ {
5626
+ "name": "baseAsset"
5627
+ },
5628
+ {
5629
+ "name": "chainlinkRwa"
5630
+ },
5631
+ {
5632
+ "name": "chainlinkX"
5633
+ },
5634
+ {
5635
+ "name": "kaminoReserve"
5636
+ }
5637
+ ]
5638
+ }
5639
+ },
5446
5640
  {
5447
5641
  "name": "pendingRequest",
5448
5642
  "type": {
@@ -8,7 +8,7 @@ export type GlamPolicies = {
8
8
  "address": "po1iCYakK3gHCLbuju4wGzFowTMpAJxkqK1iwUqMonY",
9
9
  "metadata": {
10
10
  "name": "glamPolicies",
11
- "version": "1.0.0",
11
+ "version": "1.0.1",
12
12
  "spec": "0.1.0",
13
13
  "description": "GLAM policies program"
14
14
  },
@@ -390,12 +390,7 @@ export type GlamPolicies = {
390
390
  {
391
391
  "code": 6002,
392
392
  "name": "notAuthorized",
393
- "msg": "Signer is not mint authority or permanent delegate"
394
- },
395
- {
396
- "code": 6003,
397
- "name": "missingPermanentDelegate",
398
- "msg": "Mint has no permanent delegate extension"
393
+ "msg": "Not authorized"
399
394
  }
400
395
  ],
401
396
  "types": [