@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
@@ -0,0 +1,477 @@
1
+ /**
2
+ * Program IDL in camelCase format in order to be used in JS/TS.
3
+ *
4
+ * Note that this is only a type helper and is not the actual IDL. The original
5
+ * IDL can be found at `target/idl/glam_policies.json`.
6
+ */
7
+ export type GlamPolicies = {
8
+ "address": "po1iCYakK3gHCLbuju4wGzFowTMpAJxkqK1iwUqMonY";
9
+ "metadata": {
10
+ "name": "glamPolicies";
11
+ "version": "1.0.1";
12
+ "spec": "0.1.0";
13
+ "description": "GLAM policies program";
14
+ };
15
+ "instructions": [
16
+ {
17
+ "name": "closeExtraMetasAccount";
18
+ "discriminator": [
19
+ 67,
20
+ 72,
21
+ 24,
22
+ 239,
23
+ 222,
24
+ 207,
25
+ 240,
26
+ 177
27
+ ];
28
+ "accounts": [
29
+ {
30
+ "name": "extraMetasAccount";
31
+ "writable": true;
32
+ "pda": {
33
+ "seeds": [
34
+ {
35
+ "kind": "const";
36
+ "value": [
37
+ 101,
38
+ 120,
39
+ 116,
40
+ 114,
41
+ 97,
42
+ 45,
43
+ 97,
44
+ 99,
45
+ 99,
46
+ 111,
47
+ 117,
48
+ 110,
49
+ 116,
50
+ 45,
51
+ 109,
52
+ 101,
53
+ 116,
54
+ 97,
55
+ 115
56
+ ];
57
+ },
58
+ {
59
+ "kind": "account";
60
+ "path": "mint";
61
+ }
62
+ ];
63
+ };
64
+ },
65
+ {
66
+ "name": "mint";
67
+ },
68
+ {
69
+ "name": "authority";
70
+ "writable": true;
71
+ "signer": true;
72
+ },
73
+ {
74
+ "name": "destination";
75
+ "writable": true;
76
+ },
77
+ {
78
+ "name": "systemProgram";
79
+ "address": "11111111111111111111111111111111";
80
+ }
81
+ ];
82
+ "args": [];
83
+ },
84
+ {
85
+ "name": "closePolicy";
86
+ "discriminator": [
87
+ 55,
88
+ 42,
89
+ 248,
90
+ 229,
91
+ 222,
92
+ 138,
93
+ 26,
94
+ 252
95
+ ];
96
+ "accounts": [
97
+ {
98
+ "name": "policyAccount";
99
+ "docs": [
100
+ "lamports will be refunded to the owner"
101
+ ];
102
+ "writable": true;
103
+ },
104
+ {
105
+ "name": "signer";
106
+ "writable": true;
107
+ "signer": true;
108
+ },
109
+ {
110
+ "name": "subject";
111
+ "writable": true;
112
+ "relations": [
113
+ "policyAccount"
114
+ ];
115
+ },
116
+ {
117
+ "name": "systemProgram";
118
+ "address": "11111111111111111111111111111111";
119
+ }
120
+ ];
121
+ "args": [];
122
+ },
123
+ {
124
+ "name": "createPolicy";
125
+ "discriminator": [
126
+ 27,
127
+ 81,
128
+ 33,
129
+ 27,
130
+ 196,
131
+ 103,
132
+ 246,
133
+ 53
134
+ ];
135
+ "accounts": [
136
+ {
137
+ "name": "policyAccount";
138
+ "writable": true;
139
+ "pda": {
140
+ "seeds": [
141
+ {
142
+ "kind": "const";
143
+ "value": [
144
+ 97,
145
+ 99,
146
+ 99,
147
+ 111,
148
+ 117,
149
+ 110,
150
+ 116,
151
+ 45,
152
+ 112,
153
+ 111,
154
+ 108,
155
+ 105,
156
+ 99,
157
+ 121
158
+ ];
159
+ },
160
+ {
161
+ "kind": "account";
162
+ "path": "subjectTokenAccount";
163
+ }
164
+ ];
165
+ };
166
+ },
167
+ {
168
+ "name": "authority";
169
+ "docs": [
170
+ "Must be the mint authority or permanent delegate"
171
+ ];
172
+ "writable": true;
173
+ "signer": true;
174
+ },
175
+ {
176
+ "name": "subject";
177
+ },
178
+ {
179
+ "name": "payer";
180
+ "writable": true;
181
+ "signer": true;
182
+ },
183
+ {
184
+ "name": "mint";
185
+ },
186
+ {
187
+ "name": "subjectTokenAccount";
188
+ },
189
+ {
190
+ "name": "systemProgram";
191
+ "address": "11111111111111111111111111111111";
192
+ }
193
+ ];
194
+ "args": [
195
+ {
196
+ "name": "lockedUntil";
197
+ "type": "u64";
198
+ },
199
+ {
200
+ "name": "timeUnit";
201
+ "type": {
202
+ "defined": {
203
+ "name": "timeUnit";
204
+ };
205
+ };
206
+ }
207
+ ];
208
+ },
209
+ {
210
+ "name": "execute";
211
+ "discriminator": [
212
+ 105,
213
+ 37,
214
+ 101,
215
+ 197,
216
+ 75,
217
+ 251,
218
+ 102,
219
+ 26
220
+ ];
221
+ "accounts": [
222
+ {
223
+ "name": "srcAccount";
224
+ },
225
+ {
226
+ "name": "mint";
227
+ },
228
+ {
229
+ "name": "dstAccount";
230
+ },
231
+ {
232
+ "name": "srcAccountAuthority";
233
+ },
234
+ {
235
+ "name": "extraMetasAccount";
236
+ "pda": {
237
+ "seeds": [
238
+ {
239
+ "kind": "const";
240
+ "value": [
241
+ 101,
242
+ 120,
243
+ 116,
244
+ 114,
245
+ 97,
246
+ 45,
247
+ 97,
248
+ 99,
249
+ 99,
250
+ 111,
251
+ 117,
252
+ 110,
253
+ 116,
254
+ 45,
255
+ 109,
256
+ 101,
257
+ 116,
258
+ 97,
259
+ 115
260
+ ];
261
+ },
262
+ {
263
+ "kind": "account";
264
+ "path": "mint";
265
+ }
266
+ ];
267
+ };
268
+ },
269
+ {
270
+ "name": "srcPolicyAccount";
271
+ },
272
+ {
273
+ "name": "dstPolicyAccount";
274
+ }
275
+ ];
276
+ "args": [
277
+ {
278
+ "name": "amount";
279
+ "type": "u64";
280
+ }
281
+ ];
282
+ },
283
+ {
284
+ "name": "initializeExtraMetasAccount";
285
+ "discriminator": [
286
+ 43,
287
+ 34,
288
+ 13,
289
+ 49,
290
+ 167,
291
+ 88,
292
+ 235,
293
+ 235
294
+ ];
295
+ "accounts": [
296
+ {
297
+ "name": "extraMetasAccount";
298
+ "writable": true;
299
+ "pda": {
300
+ "seeds": [
301
+ {
302
+ "kind": "const";
303
+ "value": [
304
+ 101,
305
+ 120,
306
+ 116,
307
+ 114,
308
+ 97,
309
+ 45,
310
+ 97,
311
+ 99,
312
+ 99,
313
+ 111,
314
+ 117,
315
+ 110,
316
+ 116,
317
+ 45,
318
+ 109,
319
+ 101,
320
+ 116,
321
+ 97,
322
+ 115
323
+ ];
324
+ },
325
+ {
326
+ "kind": "account";
327
+ "path": "mint";
328
+ }
329
+ ];
330
+ };
331
+ },
332
+ {
333
+ "name": "mint";
334
+ },
335
+ {
336
+ "name": "authority";
337
+ "writable": true;
338
+ "signer": true;
339
+ },
340
+ {
341
+ "name": "payer";
342
+ "writable": true;
343
+ "signer": true;
344
+ },
345
+ {
346
+ "name": "systemProgram";
347
+ "address": "11111111111111111111111111111111";
348
+ }
349
+ ];
350
+ "args": [
351
+ {
352
+ "name": "metas";
353
+ "type": {
354
+ "vec": {
355
+ "defined": {
356
+ "name": "anchorExtraAccountMeta";
357
+ };
358
+ };
359
+ };
360
+ }
361
+ ];
362
+ }
363
+ ];
364
+ "accounts": [
365
+ {
366
+ "name": "policyAccount";
367
+ "discriminator": [
368
+ 218,
369
+ 201,
370
+ 183,
371
+ 164,
372
+ 156,
373
+ 127,
374
+ 81,
375
+ 175
376
+ ];
377
+ }
378
+ ];
379
+ "errors": [
380
+ {
381
+ "code": 6000;
382
+ "name": "invalidSourcePolicyAccount";
383
+ "msg": "Invalid source policy account";
384
+ },
385
+ {
386
+ "code": 6001;
387
+ "name": "lockUp";
388
+ "msg": "Policy violation: lock-up has not expired";
389
+ },
390
+ {
391
+ "code": 6002;
392
+ "name": "notAuthorized";
393
+ "msg": "Not authorized";
394
+ }
395
+ ];
396
+ "types": [
397
+ {
398
+ "name": "anchorExtraAccountMeta";
399
+ "type": {
400
+ "kind": "struct";
401
+ "fields": [
402
+ {
403
+ "name": "discriminator";
404
+ "type": "u8";
405
+ },
406
+ {
407
+ "name": "addressConfig";
408
+ "type": {
409
+ "array": [
410
+ "u8",
411
+ 32
412
+ ];
413
+ };
414
+ },
415
+ {
416
+ "name": "isSigner";
417
+ "type": "bool";
418
+ },
419
+ {
420
+ "name": "isWritable";
421
+ "type": "bool";
422
+ }
423
+ ];
424
+ };
425
+ },
426
+ {
427
+ "name": "policyAccount";
428
+ "type": {
429
+ "kind": "struct";
430
+ "fields": [
431
+ {
432
+ "name": "authority";
433
+ "type": "pubkey";
434
+ },
435
+ {
436
+ "name": "subject";
437
+ "type": "pubkey";
438
+ },
439
+ {
440
+ "name": "mint";
441
+ "type": "pubkey";
442
+ },
443
+ {
444
+ "name": "tokenAccount";
445
+ "type": "pubkey";
446
+ },
447
+ {
448
+ "name": "lockedUntil";
449
+ "type": "u64";
450
+ },
451
+ {
452
+ "name": "timeUnit";
453
+ "type": {
454
+ "defined": {
455
+ "name": "timeUnit";
456
+ };
457
+ };
458
+ }
459
+ ];
460
+ };
461
+ },
462
+ {
463
+ "name": "timeUnit";
464
+ "type": {
465
+ "kind": "enum";
466
+ "variants": [
467
+ {
468
+ "name": "second";
469
+ },
470
+ {
471
+ "name": "slot";
472
+ }
473
+ ];
474
+ };
475
+ }
476
+ ];
477
+ };
@@ -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": [