@glamsystems/glam-sdk 1.0.12-alpha.3 → 1.0.13

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 (36) hide show
  1. package/index.cjs.js +9309 -4898
  2. package/index.esm.js +9299 -4900
  3. package/package.json +1 -1
  4. package/src/assets.d.ts +3 -0
  5. package/src/client/access.d.ts +13 -0
  6. package/src/client/base.d.ts +3 -1
  7. package/src/client/drift/protocol-v2.d.ts +37 -0
  8. package/src/client/fees.d.ts +3 -0
  9. package/src/client/invest.d.ts +1 -1
  10. package/src/client/mint.d.ts +54 -1
  11. package/src/constants.d.ts +5 -0
  12. package/src/deser/index.d.ts +1 -0
  13. package/src/deser/tokenAclLayouts.d.ts +67 -0
  14. package/src/glamExports.d.ts +210 -260
  15. package/src/index.d.ts +1 -0
  16. package/src/utils/accounts.d.ts +5 -0
  17. package/src/utils/bitmask.d.ts +3 -0
  18. package/src/utils/glamPDAs.d.ts +5 -0
  19. package/target/idl/ext_drift-staging.json +1598 -149
  20. package/target/idl/ext_drift.json +1096 -127
  21. package/target/idl/glam_config.json +3 -0
  22. package/target/idl/glam_mint-staging.json +865 -0
  23. package/target/idl/glam_mint.json +25 -0
  24. package/target/idl/glam_protocol-staging.json +305 -0
  25. package/target/idl/glam_protocol.json +15 -0
  26. package/target/types/ext_drift-staging.ts +1598 -149
  27. package/target/types/ext_drift.d.ts +1102 -133
  28. package/target/types/ext_drift.ts +1096 -127
  29. package/target/types/glam_config.d.ts +3 -0
  30. package/target/types/glam_config.ts +3 -0
  31. package/target/types/glam_mint-staging.ts +865 -0
  32. package/target/types/glam_mint.d.ts +25 -0
  33. package/target/types/glam_mint.ts +25 -0
  34. package/target/types/glam_protocol-staging.ts +305 -0
  35. package/target/types/glam_protocol.d.ts +15 -0
  36. package/target/types/glam_protocol.ts +15 -0
@@ -4560,6 +4560,16 @@ export type GlamMint = {
4560
4560
  "code": 6016;
4561
4561
  "name": "amountBelowMinimum";
4562
4562
  "msg": "Amount below minimum threshold";
4563
+ },
4564
+ {
4565
+ "code": 6017;
4566
+ "name": "tokenAclManagesFreezeThaw";
4567
+ "msg": "Token ACL is enabled; freeze/thaw is managed by the Token ACL program";
4568
+ },
4569
+ {
4570
+ "code": 6018;
4571
+ "name": "invalidMintState";
4572
+ "msg": "Invalid mint state";
4563
4573
  }
4564
4574
  ];
4565
4575
  "types": [
@@ -5870,6 +5880,21 @@ export type GlamMint = {
5870
5880
  "name": "protoMintPermSetTokenAccountState";
5871
5881
  "type": "u64";
5872
5882
  "value": "8";
5883
+ },
5884
+ {
5885
+ "name": "protoMintPermTokenAclApplyList";
5886
+ "type": "u64";
5887
+ "value": "2048";
5888
+ },
5889
+ {
5890
+ "name": "protoMintPermTokenAclFreezeThaw";
5891
+ "type": "u64";
5892
+ "value": "512";
5893
+ },
5894
+ {
5895
+ "name": "protoMintPermTokenAclManageList";
5896
+ "type": "u64";
5897
+ "value": "1024";
5873
5898
  }
5874
5899
  ];
5875
5900
  };
@@ -4560,6 +4560,16 @@ export type GlamMint = {
4560
4560
  "code": 6016,
4561
4561
  "name": "amountBelowMinimum",
4562
4562
  "msg": "Amount below minimum threshold"
4563
+ },
4564
+ {
4565
+ "code": 6017,
4566
+ "name": "tokenAclManagesFreezeThaw",
4567
+ "msg": "Token ACL is enabled; freeze/thaw is managed by the Token ACL program"
4568
+ },
4569
+ {
4570
+ "code": 6018,
4571
+ "name": "invalidMintState",
4572
+ "msg": "Invalid mint state"
4563
4573
  }
4564
4574
  ],
4565
4575
  "types": [
@@ -5870,6 +5880,21 @@ export type GlamMint = {
5870
5880
  "name": "protoMintPermSetTokenAccountState",
5871
5881
  "type": "u64",
5872
5882
  "value": "8"
5883
+ },
5884
+ {
5885
+ "name": "protoMintPermTokenAclApplyList",
5886
+ "type": "u64",
5887
+ "value": "2048"
5888
+ },
5889
+ {
5890
+ "name": "protoMintPermTokenAclFreezeThaw",
5891
+ "type": "u64",
5892
+ "value": "512"
5893
+ },
5894
+ {
5895
+ "name": "protoMintPermTokenAclManageList",
5896
+ "type": "u64",
5897
+ "value": "1024"
5873
5898
  }
5874
5899
  ]
5875
5900
  };
@@ -13,6 +13,31 @@ export type GlamProtocol = {
13
13
  "description": "Glam Protocol"
14
14
  },
15
15
  "instructions": [
16
+ {
17
+ "name": "addAssets",
18
+ "discriminator": [
19
+ 221,
20
+ 232,
21
+ 106,
22
+ 164,
23
+ 156,
24
+ 75,
25
+ 127,
26
+ 106
27
+ ],
28
+ "accounts": [
29
+ {
30
+ "name": "glamState",
31
+ "writable": true
32
+ },
33
+ {
34
+ "name": "glamSigner",
35
+ "writable": true,
36
+ "signer": true
37
+ }
38
+ ],
39
+ "args": []
40
+ },
16
41
  {
17
42
  "name": "cancelTimelock",
18
43
  "discriminator": [
@@ -38,6 +63,246 @@ export type GlamProtocol = {
38
63
  ],
39
64
  "args": []
40
65
  },
66
+ {
67
+ "name": "chargeProtocolFee",
68
+ "discriminator": [
69
+ 48,
70
+ 225,
71
+ 89,
72
+ 103,
73
+ 48,
74
+ 65,
75
+ 183,
76
+ 238
77
+ ],
78
+ "accounts": [
79
+ {
80
+ "name": "glamState",
81
+ "writable": true
82
+ },
83
+ {
84
+ "name": "glamVault",
85
+ "writable": true,
86
+ "pda": {
87
+ "seeds": [
88
+ {
89
+ "kind": "const",
90
+ "value": [
91
+ 118,
92
+ 97,
93
+ 117,
94
+ 108,
95
+ 116
96
+ ]
97
+ },
98
+ {
99
+ "kind": "account",
100
+ "path": "glamState"
101
+ }
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "name": "signer",
107
+ "writable": true,
108
+ "signer": true
109
+ },
110
+ {
111
+ "name": "depositAsset"
112
+ },
113
+ {
114
+ "name": "vaultDepositAta",
115
+ "writable": true,
116
+ "pda": {
117
+ "seeds": [
118
+ {
119
+ "kind": "account",
120
+ "path": "glamVault"
121
+ },
122
+ {
123
+ "kind": "account",
124
+ "path": "depositTokenProgram"
125
+ },
126
+ {
127
+ "kind": "account",
128
+ "path": "depositAsset"
129
+ }
130
+ ],
131
+ "program": {
132
+ "kind": "const",
133
+ "value": [
134
+ 140,
135
+ 151,
136
+ 37,
137
+ 143,
138
+ 78,
139
+ 36,
140
+ 137,
141
+ 241,
142
+ 187,
143
+ 61,
144
+ 16,
145
+ 41,
146
+ 20,
147
+ 142,
148
+ 13,
149
+ 131,
150
+ 11,
151
+ 90,
152
+ 19,
153
+ 153,
154
+ 218,
155
+ 255,
156
+ 16,
157
+ 132,
158
+ 4,
159
+ 142,
160
+ 123,
161
+ 216,
162
+ 219,
163
+ 233,
164
+ 248,
165
+ 89
166
+ ]
167
+ }
168
+ }
169
+ },
170
+ {
171
+ "name": "protocolFeeAuthority"
172
+ },
173
+ {
174
+ "name": "protocolFeeAuthorityAta",
175
+ "writable": true,
176
+ "pda": {
177
+ "seeds": [
178
+ {
179
+ "kind": "account",
180
+ "path": "protocolFeeAuthority"
181
+ },
182
+ {
183
+ "kind": "account",
184
+ "path": "depositTokenProgram"
185
+ },
186
+ {
187
+ "kind": "account",
188
+ "path": "depositAsset"
189
+ }
190
+ ],
191
+ "program": {
192
+ "kind": "const",
193
+ "value": [
194
+ 140,
195
+ 151,
196
+ 37,
197
+ 143,
198
+ 78,
199
+ 36,
200
+ 137,
201
+ 241,
202
+ 187,
203
+ 61,
204
+ 16,
205
+ 41,
206
+ 20,
207
+ 142,
208
+ 13,
209
+ 131,
210
+ 11,
211
+ 90,
212
+ 19,
213
+ 153,
214
+ 218,
215
+ 255,
216
+ 16,
217
+ 132,
218
+ 4,
219
+ 142,
220
+ 123,
221
+ 216,
222
+ 219,
223
+ 233,
224
+ 248,
225
+ 89
226
+ ]
227
+ }
228
+ }
229
+ },
230
+ {
231
+ "name": "glamConfig",
232
+ "pda": {
233
+ "seeds": [
234
+ {
235
+ "kind": "const",
236
+ "value": [
237
+ 103,
238
+ 108,
239
+ 111,
240
+ 98,
241
+ 97,
242
+ 108,
243
+ 45,
244
+ 99,
245
+ 111,
246
+ 110,
247
+ 102,
248
+ 105,
249
+ 103
250
+ ]
251
+ }
252
+ ],
253
+ "program": {
254
+ "kind": "const",
255
+ "value": [
256
+ 10,
257
+ 11,
258
+ 0,
259
+ 83,
260
+ 72,
261
+ 16,
262
+ 46,
263
+ 144,
264
+ 46,
265
+ 42,
266
+ 79,
267
+ 22,
268
+ 157,
269
+ 123,
270
+ 21,
271
+ 242,
272
+ 192,
273
+ 146,
274
+ 1,
275
+ 78,
276
+ 88,
277
+ 59,
278
+ 102,
279
+ 9,
280
+ 190,
281
+ 226,
282
+ 92,
283
+ 189,
284
+ 187,
285
+ 232,
286
+ 83,
287
+ 220
288
+ ]
289
+ }
290
+ }
291
+ },
292
+ {
293
+ "name": "systemProgram",
294
+ "address": "11111111111111111111111111111111"
295
+ },
296
+ {
297
+ "name": "associatedTokenProgram",
298
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
299
+ },
300
+ {
301
+ "name": "depositTokenProgram"
302
+ }
303
+ ],
304
+ "args": []
305
+ },
41
306
  {
42
307
  "name": "checkAndUpdateTransferTracker",
43
308
  "discriminator": [
@@ -243,6 +508,31 @@ export type GlamProtocol = {
243
508
  }
244
509
  ]
245
510
  },
511
+ {
512
+ "name": "deleteAssets",
513
+ "discriminator": [
514
+ 85,
515
+ 141,
516
+ 142,
517
+ 118,
518
+ 39,
519
+ 152,
520
+ 168,
521
+ 188
522
+ ],
523
+ "accounts": [
524
+ {
525
+ "name": "glamState",
526
+ "writable": true
527
+ },
528
+ {
529
+ "name": "glamSigner",
530
+ "writable": true,
531
+ "signer": true
532
+ }
533
+ ],
534
+ "args": []
535
+ },
246
536
  {
247
537
  "name": "emergencyAccessUpdate",
248
538
  "docs": [
@@ -1829,6 +2119,16 @@ export type GlamProtocol = {
1829
2119
  "name": "delegateAclLimitExceeded",
1830
2120
  "msg": "Delegate ACL limit exceeded"
1831
2121
  },
2122
+ {
2123
+ "code": 49018,
2124
+ "name": "assetBalanceNotZero",
2125
+ "msg": "Cannot delete asset: vault token account balance is not zero"
2126
+ },
2127
+ {
2128
+ "code": 49019,
2129
+ "name": "cannotDeleteBaseAsset",
2130
+ "msg": "Cannot delete base asset from allowlist"
2131
+ },
1832
2132
  {
1833
2133
  "code": 50000,
1834
2134
  "name": "withdrawDenied",
@@ -1954,6 +2254,11 @@ export type GlamProtocol = {
1954
2254
  "name": "invalidAccountData",
1955
2255
  "msg": "Invalid account data"
1956
2256
  },
2257
+ {
2258
+ "code": 51115,
2259
+ "name": "oraclePriceSuspended",
2260
+ "msg": "Oracle price is suspended"
2261
+ },
1957
2262
  {
1958
2263
  "code": 50100,
1959
2264
  "name": "transferRateLimitExceeded",
@@ -1100,6 +1100,16 @@ export type GlamProtocol = {
1100
1100
  "name": "delegateAclLimitExceeded";
1101
1101
  "msg": "Delegate ACL limit exceeded";
1102
1102
  },
1103
+ {
1104
+ "code": 49018;
1105
+ "name": "assetBalanceNotZero";
1106
+ "msg": "Cannot delete asset: vault token account balance is not zero";
1107
+ },
1108
+ {
1109
+ "code": 49019;
1110
+ "name": "cannotDeleteBaseAsset";
1111
+ "msg": "Cannot delete base asset from allowlist";
1112
+ },
1103
1113
  {
1104
1114
  "code": 50000;
1105
1115
  "name": "withdrawDenied";
@@ -1225,6 +1235,11 @@ export type GlamProtocol = {
1225
1235
  "name": "invalidAccountData";
1226
1236
  "msg": "Invalid account data";
1227
1237
  },
1238
+ {
1239
+ "code": 51115;
1240
+ "name": "oraclePriceSuspended";
1241
+ "msg": "Oracle price is suspended";
1242
+ },
1228
1243
  {
1229
1244
  "code": 50100;
1230
1245
  "name": "transferRateLimitExceeded";
@@ -1100,6 +1100,16 @@ export type GlamProtocol = {
1100
1100
  "name": "delegateAclLimitExceeded",
1101
1101
  "msg": "Delegate ACL limit exceeded"
1102
1102
  },
1103
+ {
1104
+ "code": 49018,
1105
+ "name": "assetBalanceNotZero",
1106
+ "msg": "Cannot delete asset: vault token account balance is not zero"
1107
+ },
1108
+ {
1109
+ "code": 49019,
1110
+ "name": "cannotDeleteBaseAsset",
1111
+ "msg": "Cannot delete base asset from allowlist"
1112
+ },
1103
1113
  {
1104
1114
  "code": 50000,
1105
1115
  "name": "withdrawDenied",
@@ -1225,6 +1235,11 @@ export type GlamProtocol = {
1225
1235
  "name": "invalidAccountData",
1226
1236
  "msg": "Invalid account data"
1227
1237
  },
1238
+ {
1239
+ "code": 51115,
1240
+ "name": "oraclePriceSuspended",
1241
+ "msg": "Oracle price is suspended"
1242
+ },
1228
1243
  {
1229
1244
  "code": 50100,
1230
1245
  "name": "transferRateLimitExceeded",